contacts.normal question

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

Ok, I messed around a bit and I came up with a workablish solution. My if statement looks like this:

if( cPoint.normal.y > 0.1f || cPoint.normal.y < -0.1f )

I only need it for approximation anyways, so this works.