Quantcast
Channel: Questions in topic: "contact"
Viewing all articles
Browse latest Browse all 75

contacts.normal question

$
0
0
Hi there, I'm trying to check contact point normals when a collisions occur. I basically have an if statement that checks if the contacts.normal.y is not equal to zero. The problem is whether the normal is zero'd out or not, the if statement remains true. Here is my code, which I'm sure is wrong: foreach( ContactPoint cPoint in collision.contacts ) { if( cPoint.normal.y != 0f ) { print ("cPoint normal:" + cPoint.normal ); gameObject.layer = 11; break; } else { continue; } } The "print" line reads out ( 1.0, 0.0, 0.0 ), which, to me, looks like the y value is at 0, but the statement is true so I'm super confused. Can anyone help me out with this please? Thanks

Viewing all articles
Browse latest Browse all 75

Trending Articles