- Home /
Error in scripting with Physics.Raycast
i need some help with scripting my game
i have a code to change the gravity .. it works if the rotation of the player is (270,90,0) but when the rotation is (90,270,0) it doesn't work with me .. so what's the problem ?
here is the code :
if(transform.eulerAngles == Vector3(90,270,0)){
ray1 = Ray(transform.position, transform.up);
if (Physics.Raycast(ray1, hit1, jumpRange)){ // wall ahead?
print("Do it");
JumpToWall(hit1.point, hit1.normal); // yes: jump to the wall
}
}
Comment
Euler angles are not unique, and they're made of floats. The == is futile.