I am working on a basic marble maze game. Where the maze is rotated around to navigate the marble through the maze.
I am having a hard time trying to figure out how to use the PlayerInputComponent when my default pawn is set to the marble rather than the maze itself. I want the camera view to be fixated on the marble rather than on the overall maze.
My main question is: how would I be able to keep the marble as the main player and rotate the maze around it?
Is this the most optimal way to set up the game? or would there be a better way?
Set the camera (or, more likely, the camera spring arm / boom) to be rotated in WORLD space, not relative space.
Typically you’ll want a Pawn hierarchy that looks something like:
Scene Root (empty scene component)
Sphere Collider component (physically simulated)
Static Mesh component
Spring Arm Component (camera boom) (set to world space rotation) (set to inherit controller rotation)
Camera Component
Custom Movement Component (this is an actor component, not a scene component – no relative position)
Then you can drive the physically simulated sphere component using forces/torques in your movement component, and you can control the camera using the player controller control rotation.
I apologize, I may not have explained what I need well enough. I am trying to get the whole maze to tilt and let physics control the movement of the marble. Not just control the camera. I know how to implement the camera movement.
I’m struggling on how to give all the movement to the maze but keep the camera focused on the marble (Player) so it’s more of a top-down style game.