Forum rules - please read before posting.
Tech questions during the weekend? Drop in on the community Discord channel!

Align moving Game Camera to different PlayerStarts

I have a scene as shown below. The blue circled camera moves horizontally affected by Target X being the player. This works great initially. 

Now I want to use a different playerstart circled in yellow, either to test the game or to let the player appear after a certain action. The problem is, the camera is still aligned to the blue playerstart and the player will be way outside the camera. How can I tell the game camera to subtract the length of the yellow arrow line to align to the new playerstart? 

I saw there is a checkbox "use default playerstart" but it does not have any affect. The camera still stays at the blue circle. I also tried to write a custom script manually setting the X position of the camera but there is no good way I found to reset the initially stored position to a new one as all methods are private.

Or is there a third even simpler way? 

image

Comments

  • If you went down the custom script route, you could instead child the camera to an empty gameobject, and then just affect the empty's position.

    The "Use default PlayerStart" feature is used to ensure that the camera's position is always correct, regardless of where the player begain the scene: the camera will use the position of the Default PlayerStart, assigned in the Scene Manager, as a reference point for movement - as opposed the Player's original position.

    It won't work, however, if you change what the Default PlayerStart actually is, so you'd have to use an OnStart Cutscene to teleport the Player instead, if you were looking to test.

    But still: it won't offset the camera itself.  For that, you're better off using two separate cameras.  You can assign a separate Camera for each PlayerStart within the PlayerStart's Inspector itself.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.