Hi everybody! I have a little problem that I can’t find the solution in this forum. When I try to rotate the Z of my main camera with the Z of the player, I get this error :
BCE0019: ‘Rotation’ is not a member of ‘UnityEngine.Transform’.
Here is my code :
#pragma strict
var target : Transform;
function Start () {
if (target.position.x < -4.605496)
transform.position.x = -4.605496;
else if (target.position.x > -1.86912)
transform.position.x = -1.86912;
}
function Update(){
transform.Rotation(0, 0, target.rotation.z, Space.World);
if (target.position.x > -4.605496 && target.position.x < -1.86912)
transform.position = new Vector3(target.position.x, target.position.y, target.position.z);
}
Everybody use the Rotation function this way… Even in the Unity API. I don’t really understand the problem here.
Can someone help me there? Thank you!