Rick Posted March 18, 2013 Share Posted March 18, 2013 I've created a TeleportTrigger. It uses a timer inside the Collision() function to trigger an output on a delay. ie. you stand in the teleport and in 2 seconds it ports you to another spot. This all works great except for 1 thing. If I stand still with the character it doesn't trigger the Collision() function. The way I see if, just because the character controller is not moving doesn't mean it's still not colliding. If 2 bodies are inside each other I would expect Collision() to be called continuously, but that's not the case. 1 Link to comment Share on other sites More sharing options...
YouGroove Posted March 18, 2013 Share Posted March 18, 2013 I think it's the way things works ? You can manage that , just by memorizing a flag saying if you have entered in the collision volume or not. Stop toying and make games Link to comment Share on other sites More sharing options...
Rick Posted March 18, 2013 Author Share Posted March 18, 2013 I could. Just seems strange because the 2 bodies are still colliding even if they aren't moving. Also, if the player moves out of the volume they shouldn't be teleported. If I set a flag in Collision() of the entity, then they move out of the teleport, they would still get sent. Would need a way to tell when the player left. Unity has an OnCollisionExit() which would be nice in LE. Link to comment Share on other sites More sharing options...
YouGroove Posted March 18, 2013 Share Posted March 18, 2013 You should post that on Suggestions There is so much suggestions , just really necessary. The forum should pin these that would be accepted. Stop toying and make games Link to comment Share on other sites More sharing options...
Josh Posted April 2, 2013 Share Posted April 2, 2013 The collision function only gets called if a collision occurs, which only happens when an entity is physically active. HOWEVER... If the collision type is set to "trigger" the collision function will be continually called, for the exact reason you describe. I use this to make invisible trigger fields to open doors, etc. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts