Determining the angle of a projectile collision.

I am trying to make a projectile that when colliedes with a surface at a 45 degree or lower will bounce and keep moving. I was trying to implement that with this code, but sadly I can’t get it to work.`if (bounce){

	var angle = Vector3.Angle(collision.contacts[0].normal, transform.forward);
	Debug.Log(angle);
	if (angle < bounceAngle){
	
		transform.position = collision.contacts[0].point + Vector3(0, 1, 0);
	
	
	}else{
	
		bounce = false;
	
	}`

Off the top of my head, give this a try:

	// Reflect the trajectory of the contact
var reflected : Vector3 = Vector3.Reflect( transform.forward, collision.contacts[0].normal );
	// Compare how alike the reflection and the original direction are
if ( Vector3.Dot(reflected, transform.forward) > 0.5 ) {
	// Do bounce logic
} else {
	// Do not-bounce logic
}

See: Vector3.Dot, Vector3.Reflect

It’s a little hard to tell without more code, but the first thing I notice is that your first line there is measuring the angle between the forward vector of the projectile (assuming this script is attached to the projectile) and the normal of the collision. If I’m not mistaken, the collision normal is perpendicular to the surface, which means the angle you want is (90 - angle), not angle itself.