- Home /
Question by
TrojanFM · Feb 11, 2012 at 08:07 PM ·
javascript
What's wrong with this code ?
Hey, i have a code to check of the rotation when i collide with something .. it's working but when i rotate to (90,270,0) the gravity change is not working .. "Print();" is working in the sentance but the others don't. and when i change the rotation to (270,90,0) it works !! so what's the problem !!
function OnTriggerEnter (other : Collider) {
if(other.gameObject.tag == "grav-right"){
if(transform.eulerAngles == Vector3(90,270,0)){
ray1 = Ray(transform.position, transform.up);
if (Physics.Raycast(ray1, hit1, jumpRange)){ // wall ahead?
JumpToWall(hit1.point, hit1.normal); // yes: jump to the wall
}
}
}
}
Comment