Access (and change) an Objects Rotation (Java)?

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?

Another slightly less crazy way of knowing if code works is to use Debug.Log. Note that it has an optional second parameter. The first parameter is a text string that will be displayed in the console. The second is a UnityObject you can supply, if you then select the line in the console Unity will highlight the object provided. Please use these to make sure your trigger call gets through properly. May aswell log if the tag check succeeds.

Thanks for the tip! But how about the fact that the door is still not opening?

Is the door not rotating at all or does it infact rotate but only1 degree like you have told it? Was under the impression nothing happened at all.