[Solved] Triggerenter and triggerleave happen at the same time

Hello,

Project is on the link: https://playcanvas.com/project/463446/overview/vr_01

I’m trying to trigger a function on “triggerleave” event on the “_teleporter-tv” entity but “triggerleave” event happens immediately after “triggerenter”, therefore it’s not possible to trigger at the right time.

Camera Offset entity contains capsule collision component and rigidbody so this is the object used for initiating the trigger, but somehow “triggerenter” and “triggerleave” events happen at the same time for all the teleporters in the scene.

Hi,

Looks like your project is private. Can you make it public or add ‘vaios’ to it?

Can I add you if we only have 2 private seats? (of which both are used for private projects)

Yeap you should be able to add me I won’t count :slight_smile:

I added you to the project with read privileges, please let me know if you need more permissions.

1 Like

OK so this happens because you disable the trigger inside the onTriggerEnter method. Which is equivalent to the body leaving the trigger as the trigger is no longer there when you disable it.

1 Like

Works flawlessly, thank you for your help and quick response!

Cheers

1 Like