Hello everyone i have followed many tutorials about a simple door opening script but i cant figure it out.So what ive donw is make an empty game object and parent it to the door.My script is this :
using UnityEngine;
using System.Collections;
public class DoorOpen : MonoBehaviour
{
public bool IsOpen = false;
public float DoorOpenAngle = 90f;
public float DoorCloseAngle = 0f;
public float Smooth = 2f;
void Start()
{
}
public void ChangeDoorState()
{
IsOpen = !IsOpen;
}
void update()
{
if (IsOpen)
{
Quaternion TargetRotationOpen = Quaternion.Euler(0, DoorOpenAngle, 0);
transform.localRotation = Quaternion.Slerp(transform.localRotation, TargetRotationOpen, Smooth * Time.deltaTime);
}
else
{
Quaternion TargetRotationOpen = Quaternion.Euler(0, DoorCloseAngle, 0);
transform.localRotation = Quaternion.Slerp(transform.localRotation, TargetRotationOpen, Smooth * Time.deltaTime);
}
}
}

In order to test it i simply move mi script to door inspector i hit play then pause and set the bool to true but the door doesnt open…What do i miss??