Hi,
I'm making a game with a first person camera and I'm trying to do a seamless camera switch that will eventually be the player's new point of view in position and rotation. I'm having trouble making the player camera adopt the new camera's rotation. I have the position figured out. Here's how I set it up:
-Player triggers an event and I use Camera: Switch to go to the new point of view.
-I then use Object: Teleport to teleport the Player to the position where the new camera is.
-This is where I get stuck. If I use Camera: Return to last gameplay, the camera rotation values goes back to what it was before the teleport which is undesirable. I've tried Character: Face Object and Face Direction, but it's imprecise. Also tried Object: Transform on the Player and Object:Transform - Rotation on the FP camera, but it just resets back to the old rotation values after the action runs.
Does anyone know if there's a way to make the FP camera adopt specific rotation values without resetting or is there a way to use the camera I switched to as my new player camera?
Thanks,
Jason
Comments
KickStarter.player.FirstPersonCamera.SetTilt (pitchAngle);
Just now getting around to using this and am getting an error when I set the pitch value of the FirstPersonCamera.
I'm just using it in a custom Action.
And the error I get is this:
error CS1061: Type UnityEngine.Transform' does not contain a definition for SetTilt and no extension method SetTilt of type UnityEngine.Transform' could be found. Are you missing an assembly reference?
Any idea why I might be getting this error? Thanks.
Apologies - it's SetPitch, not SetTilt.
Hmm, it doesn't seem to like SetPitch either since it still throws the same error:
error CS1061: Type UnityEngine.Transform does not contain a definition for SetPitch and no extension method SetPitch of type UnityEngine.Transform could be found. Are you missing an assembly reference?
Thanks, Chris! Got it working.