How to make the camera lock and follow from behind the rolling ball

I am making a game and started with the rolling ball template, it is a marble game and I want the camera to follow the marble from behind in any direction it goes.
This way if you go left the camera will auto adjust to being behind the ball and the same for all other directions.

Can this be done and how?

Please help!

If you are using the rolling ball template , here is a solution:

is this completely replacing what is already supplied in there for BP?
or is this in addition to the BP functionality already supplied ?
Thank You very much i appreciate it.

I was wondering because I will still need the functionality that comes with the project?
Then after this is implemented I can change the physics and speed of the camera to make it fit what I want to do.

You can add this to the existing Ball BP

What is the vector length attached to?
Just wanted to make sure couldnt tell from the photo.
I really appreciate it

greater than node “>”

TY , I really appreciate it

I am still having an issue because the nodes are not showing the way that you have them.
Here is a pic of what I have and you can see.

I’m sorry if I am a pain but I was trying to test it out.
I really appreciate the help.
It seems the nodes are missing some of the options that show in your picture.

-The Get Component Velocity doesn’t show the way you have it

  • spring arm relative rotation doesn’t come i that way either.
  • set relative rotation doesn’t drop down to the way you have it.

Ok, I got it to work, i just needed o expand the nodes, Sorry about the babble.
The issue I am running into right now is the camera spins rather quickly and overtime you hit a button it goes nuts. Is there a way to slow that down or make it smoother so it doesn’t make people throw up when they play the game?
I know I have asked a lot but just wanted tom make it a smooth following camera. Every time it hits something the camera swings and that makes it really difficult for the player to keep focused and see where they are going?
I know I can lock the camera, but do not know how to have it that way and still have it swing, Would this mean I have to set key presses to make it work or can it work only when those buttons are pressed and not when the camera bumps into things?
Thanks again

1 Like

Ok, I got it to work, i just needed o expand the nodes, Sorry about the babble. The issue I am running into right now is the camera spins rather quickly and overtime you hit a button it goes nuts. Is there a way to slow that down or make it smoother so it doesn’t make people throw up when they play the game? I know I have asked a lot but just wanted tom make it a smooth following camera. Every time it hits something the camera swings and that makes it really difficult for the player to keep focused and see where they are going? I know I can lock the camera, but do not know how to have it that way and still have it swing, Would this mean I have to set key presses to make it work or can it work only when those buttons are pressed and not when the camera bumps into things? Thanks again

You want the cam rotation to depend on pressed key instead of velocity?

if want the cam rotation to depend on pressed key ,

1 Like

no not really, I thought of doing it that way but what I am having an issue with right now is that every time the marble bumps something it makes the camera shake. Example: if I am jumping the marble up stairs, when it hits the back of the stair it swings the camera.
I guess I am asking sine W,S,A,D move the marble can we lock them to the only buttons that move the camera and not when the marble collides with environments , otherwise I fear it will make the player sick if the camera jumps on ever little touch or jump.

My biggest concern like I had is the “shaky” camera that comes from bumping into everything. I’m not sure but that why I had asked about the key press option , I don’t really want to have to key press to set the camera every time. I just want to eliminate the camera shaking or moving when bumping into (Ex) stairs, walls etc.

Does the photo above stop the camera from shaking every time it collides with something

the camera rotation will not change if you hit something

ok so the p;ic above with that added node will stop it from moving every time you hit something?
If so I wil ltry it when I get home , Man I really appreciate it, you have no idea.

1 Like