|
Hello. I want to make a king of the hill type area in my scene. When the player is in it, another object is active and when the player is not in it, said object is not active. I have tried to do this, I am not getting any errors, but it is not working, what is wrong with my script(it is attached to the hill area)? Thanks
(comments are locked)
|
|
Does your hill area your script is attached to have any collider with isTrigger true ? It seems odd to destroy the hill once you enter it though, you sure about that ? And yoyo is right, you need {} or else anything with a collider entering your hill area will trigger the destruction.
(comments are locked)
|

Get the player, get the zone, get the distance between, if distance is less than __ (Meaning in it or next to it), do the activation (Change color of lights or whatnot, change materials?), else, make it normal...
I'm not a Java guy, but don't you need curly braces {} around the two statements following the "if"? Looks like the Destroy may run every time.
@yoyo No not all the time. Sometimes it works just as well, without the brackets, but sometimes it dont. :)