- Home /
Collision detections fails to re-detect an object
Hi, Sorry if it's a noobish question, But in my OnCollisionEnter, whenever it detects a collision with Object A, and then detects collision with Object B - Once there's another collision with Object A, it doesn't respond to it... My code:
function OnCollisionEnter(collision:Collision){
if(collision.gameObject.name=="ObjectA")
Debug.Log("1");
if(collision.gameObject.name=="ObjectB")
Debug.Log("2");
}
So i'm guessing your console will show "1", "2" and then nothing after that?
I don't want to insult your intelligence so this is purely just my first thought but there is a button on the console called "Collapse" this will group any debug messages that are the same together, just make sure this isn't what is happening. If it's disabled you should see e.g. 1, 2, 1, 2, 1 , 2 otherwise you will just see 1, 2 and then a counter next to them showing how many times they have been logged.
Let me know :)
Answer by Travis-Bulford · Jul 01, 2013 at 03:24 PM
Has the collision exited?
Check if OnCollisionExit is called. You should not get another Enter until the objects have parted.
Your answer
Follow this Question
Related Questions
WALL collision detection problem... help!!!! 0 Answers
collision detection 4 Answers
Detect collision from a another object,Detect collision from another script 2 Answers
Collision Detection 2 Answers
onCollisionEnter 1 Answer