How to attach a player to a moving object

I have a hospital bed object that I am moving along a spline. I want to put the player on the bed and for them to move along with it along the spline and only be able to move the camera a certain amount.

I get it to work by attaching a camera to the bed mesh, but I cant for the life of me get the camera to move without being a pawn. If I put a FirstPersonController on the bed, and change the blueprint so that they cannot move (unlink movement) they fall through the ground.

Any hints would be appreciated. Also, I don’t need any collision for the player, they basically have to just be able to look

As a part two, I would also like to limit how much they turn, which once I solve above I am sure I can add as a blueprint.

hey :),

have you tried using the Possess node to get control of the camera?

Or wait,
you didnt want to use a pawn right?

uhm

may i suggest you do make it into a pawn and add the floating pawn movement component to it. then add some simple controls for the camera and maybe clamp those axis values so you get this limited camera rotation you were mentioning? or maybe add a branch to the tick event to check if the camera has exceeded a certain rotation, if true set rotation with lerp back to 0,0,0 rotation or something…

Hope it helps in any way :slight_smile:

cheers

Hello!! I want to do exactly the same! I really want to make a roller coaster, to get on a vehicle and look around following a spline. Have you got it?

Disable physics on the pawn for attaching it (it will fix it not moving along and falling through the ground). And use a clamp for the camera rotation :slight_smile:
Hope this helps

SetPhysics( PHYS_None );

If your pawn has CharacterMovement you need to override GravityScale variable to Zero. That variable stored in CharacterMovementComponent