Camera moving along a spline

hey guys , i’ve been trying so hard to learn unreal and so far it is a great experience , but there is one thing i could not understand , i can’t figure out how to move camera along a spline , and make that camera follow player where
please i need to learn this , its very important for me , i tried to look up some tutorials on youtube but the only one was for left and right game and i want my game to be exactly like crash bandicoon camera ::

1 Like

Hi,

Here’s a quick overview of how to accomplish what you want. First, get a reference from your Spline and save it in your Character BP. Next, set up your blueprint as in the picture below and you should get the behavior you want.

The DistanceToPlayer variable determines how far the camera should be from your character. Note that you should use a Tick event for this and update it every frame to get a smooth camera movement.

Hope this helps.

thank you man , i’ll try it and see if its gonna work
you are one of a kind
Only one question though what is the first node that says ( you actor ).
thanks

You’re welcome. That node, as its name implies, is your player controlled actor (character) that you want your camera to follow. If you’re implementing this in your Character BP then you can just remove it and the Target pin will automatically gets set to self.

Please consider marking the question as “resolved” if your issue has been addressed to help the community in both referring to this solution and also better filter the unanswered questions. Thanks :slight_smile:

hey man
im so sorry for asking you again ,but i tried 3 times and i couldn’t figure out what the (distance to player) node is , if you could be so kind and tell me how did you get it
please im in need of this
thanks and sorry.

hey man
i ran into some problem , every time i try to connect camera node with the SetWorldLocation nod
this happens

Can you please help me.

Hey,

The Distance To Player node is just a float variable that determines how far you want your camera should be from the Player. Create it as you would create any other variable in a blueprint and set it to some default value. For example, if you want your camera to be 5 meters away from your player, then set that to 500 (unreal units are in centimeters).

Hope this clarifies it :slight_smile:

I’m not sure why you’re getting a Root Component there. Just use the top left “Add Component” button and add a “Camera Component” to your scene. Drag that camera to your scene and connect it directly to the Set World Location. It should work fine!

im so sorry for my ignorance im a beginner ,
i managed to work the camera node , but i ran into some new problem
the spline camera is stuck on the back of my character , and its following the player not the spine
again so sorry and thank you

i did not understand that , can you do a screenshot please ?

it did not work
omg im about to lose myself everytime i do something , there is a problem
btw the camera ref in this picture is it the level camera or the camera that i created with the spline , cuz i deleted the camera and the camera boom for the original template
i referenced the spline camera but it did not work
thank you anyway man and i so so so so sorry for making you do this

That’s because you’re implementing this in your character’s blueprint and the Camera component is attached to your character! Get a reference to your camera and at BeginPlay, call the function “Detach From Component” to detach your camera from your character. It should work now!

Here’s a screenshot. I suggest you start with more basics stuff and understand the whole structure of blueprints before you try building a whole new game from scratch! You’ll be more productive if you take your time to learn the tool you’re using.

Good luck on your UE4 adventure :slight_smile:

225328-cameradetach.png

This is the camera in your character BP. It is attached to your character and moves with it. Doing this will detach this camera from your character and hence, you can update it =s location and rotation using that initial BP I provided you with.