Wednesday, December 6, 2017

unity - Check which object triggered another



Two animated car object both contain a rigid body, a box collider and a script with an OnTriggerEnter event.


I want to check which car started the collision event, by hitting the other car.


Consider two cars; regardless of whether carA hits carB or carB hits carA, both cars contain the same script with the same event. So both cars become the trigger.


How do I identify which car started the collision? I wish to do so without the use of raycasting, as it is too expensive for what I am wanting to do.




No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...