Download

How do I set the up vector of a SpringArm?

Right now, I have a camera attached to a SpringArm, and I can rotate it around my character by changing the yaw, and rotate it up and down (within a clamped range) by changing the pitch. The up vector in this case - for both the camera’s orientation and the camera’s movement around the character- is the up vector of the world (0, 0, 1).

I want to change the up vector so that this camera can work if, say, you’re running up a wall. I can set the “roll” of the springarm but that only affects tha camera’s roll, and not its movement about the character. Are there any example projects or tutorials for, say, a character running around a small planetoid with spherical gravity?

(I’m actually using a PhysicsBallBP and not a Character so I can ignore any complications that result from the Character itself - I only need the camera to work.)

This is my blueprint currently: I use the Turn and LookUp axes to store the yaw and pitch in my own variables, then construct a rotator using those variables to assign to the SpringArm. The Turn axis rotates around the character (around the up vector) and the LookUp axis rotates up and down (towards the up vector).

And this is the BP’s hierarchy:

How would I change this math to be able to define an up vector?