I’m learning to program using visual scripting Blueprints, and am trying to make First Person player movement for Zero Gravity planet-hopping, similar to Outer Wilds, with the player being able to roll the camera and spin 360 degrees pitch (head over heels), with movement and look rotations applied relative to the character at all times. This person’s video shows what I’m trying to achieve, but in First Person instead of third.
Every time I get any look controls working for this, the inputs always seem to apply relative to the world axis, so when rolled, the player doesn’t rotate in the right directions, and I encounter what I think might be gimbal lock, where rotating in certain axes doesn’t work at all.
I have my look inputs set up to store in variables like so:
My most recent attempt involved trying to use Quaternions, following this guide, but even with the new C++ code inserted and the custom player controller, the rotation isn’t relative to the player / camera.
Hey thanks sm for your reply! Yes that’s exactly what I’m trying to do.
Sadly I’m not having any success with the Add Actor Local Rotation function, the problem seems to be the same: the rotations are applied in directions which seem relative to the world axis, which get pretty crazy / locked as soon as the player rolls.
Like this? I’ve moved it to the character blueprint and got the camera’s right vector but the problem seems exactly the same, still doesn’t apply the inputs relative to the player / camera, but creates the same look issues in the video above.
Any ideas what to try next? Really appreciate your help!
Are you using the first person character for this?
I tried that. Can get a very nice floaty movement, move the direction the camera is facing etc, but can’t do things like roll. I think the character movement might be fighting it.
I made a pawn from scratch, and immediately got it to roll
I honestly can’t thank you enough. Just came back to this after a very busy period at work. Your suggestion of creating a new pawn was exactly what I needed to do. I’d been so bound to the First Person Character I hadn’t realised it would be confining the movement. Weeks of banging my head against the wall for such a simple solution. THANK YOU!
Now I just need to get my planet gravity system working again… Wish me luck!