Forum rules - please read before posting.

Offset transform option for 2D camera tracking player?

Hello

I've set my 2D camera to track my player's movement. This works great for horizontal movement, but for vertical movement, I'm finding that the camera is centering on the player's feet (presumably because that's where the pivot is) rather than his upper body, which presents me with a problem, as his head is now going off the top of the screen.

Would it be possible to add an option to offset the position of a camera following a player in order to resolve this? At the moment, under 'target object to control camera movement', if you select 'target is player', you can then select 'follow speed' - could 'offset' be included under 'follow speed' so the user can enter a transform by which to offset the camera?

In the meantime, can you recommend any workarounds?

Many thanks!

Daniel


Comments

  • The GameCamera2D component already has Offset fields - for both Horizontal and Vertical movement, rather than a singular value.  Check the 2D Demo game - that's how the camera keeps the player character in view.
  • Whoops. An oversight on my part. Too much looking at screens. Thanks for pointing that out, Chris! You the man.
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.