Jump to content

[LE3] Script:Collision only runs when moving?


Rick
 Share

Recommended Posts

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.

  • Upvote 1
Link to comment
Share on other sites

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

  • 2 weeks later...

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

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...