- Home /
I am having a problem with detecting certain collision?
Hello,
I have two rigid bodies. One of them has isTrigger set to true(Object 1) and the other is set to false(Object 2). I want to be able to detect the collision between these two objects from an attached script on Object 2. I can easily detect the collision from a script in object 1 using the OnTriggerEnter function, but that will not work for me since it is causing me other problems. These problems would be solved If I am able to detect the collision from a script attached to Object 2.
Any Ideas how I can accomplish that?
Any help is appreciated.
Thank you very much
Answer by FL · Jun 02, 2013 at 01:45 PM
http://unitygems.com/mistakes1/ , third topic.
I actually read that before posting my question. It does not answer my question. Thanks for the help though.
Okay, let's resume: You can only detect a collision with a Trigger with a script in the Trigger GameObject. The best that you can do is to, in Object1 send a message to Object2, so this activates a script in Object 2.
yes, sending a message from object 1 to 2 will rise problems as I stated in my original questions. I have to detect the collision in the second script. From your answer I think you are saying it is not possible to detect it from the other script using the functions. =/ Atm I am trying to detect the collision by measuring distances from both objects, and I manually trigger it when they are close to each other.
Your answer
Follow this Question
Related Questions
Colliding two GameObjects 1 Answer
On Trigger Enter, Collide with object, specific collision 1 Answer
Trigger Spawning? 1 Answer
Keep doing something while colliding 1 Answer
Slow collision triggers late 0 Answers