Rollercoaster type blueprints - advice needed

Hello all,

I’ve just started delving into UE4 and started a small project but I’ve hit a stumbling block, so I’m looking for some advice to get me on the right track.

This is my goal - have a static mesh move forward at the same time as the player camera for a set distance. Lets say move in X for 30000 units.
The desired affect is like stepping into a rollercoaster and have it take you for a ride (in a straight line).
Now from my experience with UDK, I can easily achieve this with a Matinee, which I have for the time being to test my level. I have the static mesh(lets say its a rollercoaster carriage) on a movement track and a camera that moves in a parallel track.

But this does not give me the flexibility I want.
The camera needs to be player controlled. Fixed in position, but the player can look up, down, left and right. Which as far as I’m aware cannot be achieved with a matinee sequence.

The sequence I am looking to achieve is - Player enters the carriage and is locked into position (sat down), the carriage then moves forward at speed for a set distance, the player can look around but not move while the carriage moves forward.

I have tried using the level blueprint to move a “carriage” blueprint on trigger, which works fine using a timeline vector track, but when I attempt to attach a camera I run into problems. I do not know how to possess the camera and have the camera be attached to a fixed point in the blueprint that contains the static mesh and have them move together.

I have attempted to use the UFO blueprint example in the Content Examples, but I am unable to get it working for my blueprints, especially as that sets the player controller to the whole blueprint and not a fixed camera.
I assume my “carriage” has to be a pawn blueprint, but I only wish to posses the camera and have the blueprint carriage move in a set direction for a set distance.

I’d appreciate any advice, just to get me on the correct track.

I simply want to take a player for a little ride :slight_smile: (simply being the operative word)

Thanks

Can you update the player location only per tick? that should bring them along for the ride.

Ah that sounds intriguing thank you. I’ll have to look at what nodes i can find for player location updating. Do you know which node can actually breakdown the carriage timeline to per tick for the player location?

Looking around it seems I’d need to use Event Tick to fire every tick to update player location to the same place in the vector timeline.

Certainly not an approach I thought of. I’ll look into it. Thanks.

Sounds like you should just need to:

  • Create a Pawn based BP (you don’t need the stuff in Character)
  • Add some kind of component to act as your root
  • Hook up controls to modify the Control Rotation Yaw and Pitch (you can see this done in the First Person template)
  • The pawn settings bUseControllerRotationPitch/Yaw/Roll default to false, so the pawn should not rotate when you look around
  • Add a CameraComponent and adjust to where you want it
  • The camera component bUseControllerViewRotation setting defaults to true, which is what you want.
  • Move the pawn each frame, either by called Set Location, or attaching it to something else

Amazing, thank you very much!
Its great to get advice from someone who’s really in the know! I wasnt expecting a dev response. I thank you sir.

I will try this out as soon as I can.

After being away for easter I’ve finally found the time to implement and after quite a bit of trial and error I now have it working! Thank you very much.
I found a bit of a bug with the context sensitive menu always hiding the Possess function which caused me a bit of a headache.

But I can now walk up to my asset, trigger the possession of my pawn, look around inside the object and trigger a timeline that moves my pawn with the movable camera along the vector timeline which is exactly what I wanted.

I am currently trying to figure out how to fix the Camera initially facing the wrong direction, with UseControllerViewRotation enabled this will always happen, the only way to fix it is to turn it off, but this disables the ability to look around. So I am investigating a method of setting the view rotation when possessing the pawn. If anyone has any ideas, I’d appreciate it.

Thanks again for the help setting this up!