hey dudes… i want to do something like a colision… but both of the object are stationary, yet… when one of then is inside eachother’s trigger box a event must happen
but i realized that this is impossible to do it… because unity only detects that the object is inside the colision box area when this very object is moving… if i for example instantiate the object direct inside the box collider . and he stands still since the moment he was born, the collider wont do anything
to prove my theory i added some forced to one of the objects and then it detected colision
so my question is…
is there anyway to check if the object is inside a trigger box even if he is completely imobile (and the triggerbox is also imbolibe)
?
I had some issues with collisions before, but then I found this video and it set me straight.
Hope it helps
Have you tried OnTriggerStay? I think one of them would need a rigidbody. I’m not at a computer to test it.
i must give congratulations to you two for undestanding what i meant, because i think if someonelses asked me such a question i would have no ideia what the person was talking about xD
anyway, both the video AND the ontriggerstay helped alot!.. i had no idea of this code… ontriggerstay… very usefull
No problem, if you have any other questions I’d be happy to try and answer them. I’m pretty new to Unity myself , only started last week.
If one of them has a Rigidbody, and you are moving it via Transform, you can call rigidbody.WakeUp() to get it to detect Collisions again.
Things that arn’t moving are ‘put to sleep’ with regards to the Physics Engine to make it run faster. All you need to do is Wake it back up and it will detect collisions again (until it sits at rest long enough to fall back asleep).
However I’m still unsure if two triggers can interact with each other effectively.