Player exits car, need proper rotation - syntax help.

Sorry been a long day.

EDIT : C#

Hey guys. So I’ve got a player that exits a car, the direction hes facing is the original when he got in (which could be anything when the player goes to get out) I want to fix this. I could have him look at the car, but I want to add a + 90 degree look off of that. I already have the look at car setup, I cannot however find the correct syntax to tact on a +90 look from the car…

I mean I could put a inv object in front of and slight left of the car - but there has to be a better method?

I’m not sure what exactly what you have for code, but assuming in the script you already have a reference to the player and the car, you could use this :

c#:

//Code to exit Car Here//

//Setting rotation
player.rotation = new Vector3(0, car.rotation.y + 90, 0);

JS:

//Code to exit Car Here//
    
    //Setting rotation
    player.rotation = Vector3(0, car.rotation.y + 90, 0);

This set’s the players rotation around the y axis to the same as the car (So it would be facing the same way) and then adds 90 degrees to it. (Note: the rotation added may need to be some other increment of 90 degrees to get it to face the direction you want)