Search Unity

Trigger Question

Discussion in 'Scripting' started by francy75, Oct 21, 2014.

  1. francy75

    francy75

    Joined:
    May 1, 2013
    Posts:
    5
    Hi all!

    I've the player with his capsule collider, I've another model with his box collider set a trigger and this model is moving inside the scene; I also wrote a C# script that make some action when the player stays inside the trigger by using the OnTriggerStay function.
    If I move the player inside the trigger everything works fine but if I don't move the player and I wait the moving trigger reaches the character the code inside the OnTriggerStay function is not executed no matter if the character is actually inside the trigger.
    Is this a correct trigger behavior? If it's so, there's any way to overcome this problem?

    Thanks in advance for any help ;)
    Francesco