change the rotation

hey ,

i want to rotate an object to (270,0,180) if the player rotation is (90,90,0) or (270,270,0) but else that i want to rotate the object to (270,0,0)

could someone code this in javascript ?

Thanks !

Unity is all about learning! You can’t just make people write your scripts for you. However, it’s a relatively simple script. I’ll give you some pseudo code which you can extrapolate on:

if (player.transform.rotation == Quaternion.Euler(270,0,180) || player.transform.position == Quaternion.Euler(270,270,0)) {
		object.transform.rotation = Quaternion.Slerp(startRotation), Quaternion.Euler(270,0,180), Time.time * 0.1);
	} else {
		object.transform.rotation = Quaternion.Slerp(startRotation, Quaternion.Euler(270,0,0), Time.time * 0.1);
	}
}

For more info on Quaternion.Euler and Quaternion.Slerp, go here and here.

Hope this helps! Klep