var smooth = 2.0;
var DoorOpenAngle = 90.0;
var DoorCloseAngle = 0.0;
var startPosition = 0;
var open : boolean;
var enter : boolean;
var rotateAround : Transform;
function Start(){
rotateAround.rotation = Quaternion.identity;
}
function Update (){
if(open == true){
if(transform.rotation.y != DoorOpenAngle){
transform.RotateAround (rotateAround.position, Vector3.up, Time.deltaTime * smooth);
}
}
}
I have tried so many things but i am not getting my result. I want this object to rotate around rotatearound but i cant seem to make it slerp and RotateAround at the same time…
If i make the door into an quaternion identity it will go to angles 0 0 0 which i dont want