Camera goes wild on my rolling ball

Hi!

I was trying to re-create a rolling ball game, but with impulses rather than torque.
I created a blueprint for my pawn:


It’s basically the same as in the rolling ball game example, except I use sphere collision with simulated physics as the root, and all the impulses are applied to it, instead of the ball itself like in the example project.

However… My camera rolls with the ball. Which is very funny, but also unplayable, as you might imagine!
I was trying to figure out what is the difference between how I attached my camera, and how it was attached in the rolling ball game example. And everything seems exactly the same - spring arm is attached to physically simulated root of the scene that rolls around.

So I can’t figure out why MY camera rolls with the ball, and camera in the example - does not.

HELP! :smiley:

I should probably mention that I’m trying to make a third person camera and the ball being controlled like in third person view: i.e. when you press W it rolls in the direction of the camera.

I think the spring arm is attached to the ball.

Try dragging it here

image

( It’s hard to tell from the pic ).

Thank you for the reply.

Yes, it is attached to the ball (collision). Attaching it to static mesh does the same thing since the mesh also rotates with the collision (which is the intention).

Here’s how it’s done in ball game example:
image

As you can see - the camera is also attached to a physically simulated root that rolls around.

Ok, I figured it out :smiley:

I had Z offset on the spring arm to make camera go higher than the ball. When instead I should have Z offset on the camera itself.

That was causing the issue. After I reset spring arm coordinates, it stopped rolling around with the ball.

However, side effect was - when looking from top-down, camera was rolling over the ball, cutting off vision at the bottom of the screen:

So I attached a spring arm with zeroed coordinates to the ball, and then another one to this spring arm:
image

This fixed the issue with both rolling and camera behavior:

2 Likes