When I hit trigger.
Trigger is to rotate my character 90 degrees on the y axis.
But for some reason it’s rotating my character 180 degrees.
I double checked there is no duplicate of the trigger… and the scripts only on the trigger…
Ive tried setting the Quaterion to 45 just to see if it made a difference, but it doesn’t, so I need advice.
Heres my script
private var turn = false;
function OnTriggerEnter (other:Collider){
if(other.CompareTag("SSPlayer")){
turn = true;
}
}
function LateUpdate(){
var player = GameObject.FindGameObjectWithTag("SSPlayer");
if(turn == true){
player.transform.rotation = Quaternion(0,45,0,0);
var cam = GameObject.FindGameObjectWithTag("CamToggle");
var cs = cam.GetComponent(CameraToggle);
cs.CamSelect = 1;
var ssp = GameObject.FindGameObjectWithTag("SSPlayer");
var sp1 = ssp.GetComponent(SSController);
sp1.cont1 = 1;
var sp2 = ssp.GetComponent(SSController2);
sp2.cont2 = 1;
turn = false;
}
}
Thanks in advance to anyone who answers!