I’m trying to do a really simple door opening script. Right now I have a cube (the door) in a GameObject (hinge). The hinge has a Hinge Joint attached and a spherical Spherical Collider. When the player enters the sphere, I would expect the hinge (and the door) to rotate. Here is my code…
void OnTriggerEnter ( Collider other )
{
this.transform.Rotate(Vector3.up,Time.deltaTime);
}
I looked and there were a number of complicated solutions. But It seems like this would work, but it doesn’t. Any ideas? Thanks.