Forum rules - please read before posting.

PlayerStart2D and Camera

HI there,

In one of my scenes, there's a Hotspot which includes an 'Object: Set Parent' action. This action affects the player by assigning them a parent game object. I've observed that, after my player triggers this action and switches scenes, PlayerStart2D doesn't seem to function as expected. The player does spawn at the PlayerStart2D Marker, but the Camera doesn't follow, despite me assigning 'Camera on start' to NavCam 1 (Game Camera 2D). Could the issue - the Camera not being located where the Player Character spawns - be related to the 'Object: Set Parent' action? Or could I be overlooking some aspect of the camera settings in PlayerStart when switching scenes? Your help is greatly appreciated. Thank you.

Comments

  • Hard to say - as this is a visual issue, could you share screenshots to illustrate the behaviour?

    Though, generally speaking I'd recommend avoid parenting the Player to anything - at least outside of a cutscene where things are restored afterwards.

    What's the scenario that requires the parenting?

  • Thank you so much for your prompt reply! Your suggestion worked - I deleted 'Object: Set Parent' and now the Player Character spawns at the designated location when the scene is switched.

    I had used 'Object: Set Parent' so that the Player Character could move with a small swim tube, as if the character was riding it. I replaced 'Object: Set Parent' with 'ActionList: Run in Parallel' and used 'Object: Transform' for the swim tube and the character. Is there a more efficient way than this setup?

    Thanks again, Chris. I hope you enjoy your weekend!

  • Thanks, and you.

    Is there a more efficient way than this setup?

    The best way I find to sync up the animation of different objects is to use Timeline - with each object animated via a separate Animation Track.

    To animate the Player, place an instance of your Player in the scene in Edit mode and use it to create an AnimationTrack as normal. Then, remove the Player from the scene, and use the Engine: Control Timeline Action's Remap bindings? option to re-link the track with the spawned Player at runtime.

    A guided demonstration of this technique can be found at this point in the 3D Primer tutorial.

  • Thank you so much again, Chris! I'm looking forward to trying out this new approach with the Timeline right away. Thank you once again!

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.