Forum rules - please read before posting.

Leaning in first person

I'm creating a first person stealth game, and I'm having some difficulty implementing a leaning system. I want to be able to peek around corners, but as of my testing the player moves upwards when I rotate the camera or the player, if I try to move while leaning.

What would be the best solution for fixing this?

Comments

  • Is the Player's root position moving, or is it just the camera?

    AC will take control of the "First Person Camera" transform, so if you want to add a leaning effect on top of that you'll need to create an empty that sits between the Player's root and the First Person Camera in the Hierarchy - and then move that empty to create the effect.

    If the Player's root is moving, I would need to know the custom script you're using to handle the effect.

  • I was trying to rotate the camera on the Z axis, which created the flying problem. I decided to just do the empty game object and move it slightly down and left or right while being on the same level of rotation. If I tried to rotate the empty the same way the problem persisted.

  • What you can try instead is moving the Camera component to a child object, one level below the First Person Camera component, and then rotate the Camera object - so that the First Person Camera object, which is what AC rotates, is unaffected.

  • I tried that, I'm not entirely sure if I did something wrong but the problem still persisted. I think what I'm using now is good enough.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.