edited July 2015 in ORK Support
Hi,

I just wanted to check if this option was available in ORK before I start trying to figure it out with code :)

I have my camera following the player and currently trees and buildings are blocking the view. I am thinking of doing it so that when the camera gets blocked it will make the tree or building transparent.

Is this doable in ORK or would I need to script it somehow ?
Post edited by martyn on
  • You could use a Raycast Object step to find stuff between the camera and the player and use Fade Object steps to fade their alpha color value.
    Would require a shader on the objects that supports transparency :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Ah great, is there a tutorial on doing this at all with ORK?

    Not sure where id place the step and fade etc etc :P
  • Pretty simple - place an event interaction on your camera with start type Autostart and enable Repeat Event (maybe with a short wait between them for performance reasons, set a time in Reenable After).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks a lot!

    Will look into this tonight :)

    Not really done to much testing/playing around with ORK other than the little game tutorials, so need to sit down and do more

    Thanks again
  • Hey

    I have been trying to have a play around but cannot seem to get this to work.

    I have created the event "CameraObstruction" and attached this to the Main Camera.

    In the Main Camera settings I have put;

    Event Interaction - Autostart, Repeat event, Start after 0., Reenable after 1, Interaction type "Event"

    In the Event Settings;

    * Use Main Camera

    * Event Actor - Added Actor and type is Player

    Raycast Object

    * Change Type : Add
    * Use Root
    * Raycast settings, Distance - 100
    * Ray Origin: User
    * Object: Actor
    * Actor: Player

    On fail - Fade Object

    * Fading Objects - Object: Found Objects
    * Fade Settings: Fade Children
    * Fade Alpha, red, green, blue
    * From Current checked
    * End Alpha 255

    AM i missing something as not sure why this is not working..

    If screenshots are needed, let me know :)

    Thanks a lot!!
  • Try using the Screen ray origin instead, without any offset, it'll raycast in the center of the screen.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • hey

    I have updated Ray Origin to screen and it works.

    The problem I am having is that the leaves on the tree only fade once the player is near the centre of the tree, although ideally id want it to happen as soon as the player goes out of view.

    Been playing around with things but cannot get that bit sorted :P

    Thanks
  • You can either use multiple raycasts with offsets (e.g. left and right of the center), or add big colliders (e.g. as triggers) to the objects to hit them earlier :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks :)

    I have added a collider to the tree and that seems to work

    Do you know if there is anyway of making something invisible but keeping the shadows? Looks a little off when the tree goes as the shading also vanishes lol

    Thanks
  • I have done it so I have 2 tree prefabs on the same spot and set one to be shadows only, this seems to do the trick :)

    Thanks a lot for the help, I REALLY appreciate it :)
  • I guess that's one solution :)
    Otherwise you'd need to find/write a shader that would do that for you.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Ah thanks :)

    Levels are small and aimed at desktop so doubling up on trees shouldn't impact performance so will leave it at that hehe

    Thanks again for all the help :)
  • if you have ufps they have a invisible shadow caster material
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • Ah thanks, will look at that

    It still didn't work as id like so I plugged in Playmaker (as I have used this in the past) and seems to be working a little better. Need to improve it a little more :)
  • You could also try using Makinom, it's got pretty badass raycasting functionality and works like ORK's event system :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.