Hello everybody, I’m really new to Unity and Java so I’m trying to learn a little bit by reading the API and trying to figure things out myself. Basically, this is my problem: I have an Empty Game Object that when collided with, it should trigger a Door’s rotation. I made a simple script, this is the sample:
#pragma strict
var target:Transform;
function OnTriggerEnter(other:Collider)
{
if(other.tag == “Player”)
{
target.transform.Rotate(Vector3(0,1,0));
}
}
The only thing different from the original script is that in the real one I also added a line that moves the Empty Game Object once I collided with it, it’s my crazy way of knowing wether at least some part of the script works (and it did). Could you guys please tell me what am I doing wrong?