Announcement

Collapse
No announcement yet.

Problem with Unreal's Forward Axis - Camera Sway

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Problem with Unreal's Forward Axis - Camera Sway

    Hi everyone!

    I'm converting a third-person project into a first-person game and I'm trying to set up a camera sway to my character but I've noticed that the default front axis for the camera is the X-axis while the character's is Y:

    Click image for larger version

Name:	Axis-0.jpg
Views:	195
Size:	223.8 KB
ID:	1665148

    I'm using the default character from the engine. Could I change these parameters so I can sync the camera movement with the character properly? If not, how would you implement a camera sway system to a mesh?

    Here is my work in progress:

    Click image for larger version

Name:	Axis-1.png
Views:	145
Size:	167.7 KB
ID:	1665149

    Click image for larger version

Name:	Axis-2.png
Views:	153
Size:	228.5 KB
ID:	1665150

    Again guys, any help will be much appreciated.

    #2
    I have come into this same problem, just rotate the camera perhaps?

    Comment


      #3
      I've actually tried that but it turns back as soon as the game starts.

      Click image for larger version

Name:	SwayBug.jpg
Views:	137
Size:	174.6 KB
ID:	1665327

      The character faces the Y-axis while the camera faces the X-axis. It is not a problem when playing normally, but when I try to configure the camera sway it just goes independent from the mesh.

      Comment


        #4
        Rotate the base mesh inside the character BP. It usually works.

        Comment


          #5
          It didn't work either. Same results. I've been searching the net for a different solution to implement this feature but all I've found was related to first-person projects. As I said, I'm converting a third-person project into an FPS. It would be really nice to have that DOOM feeling while rotating the character and it's pretty ugly the way it is.

          Comment


            #6
            So, maybe explain what sway means for you.
            That would be the first step to get everyone on the same page on what you are actually trying to do.

            Second, if you are doing this in BP, you can break the vectors and cross the axis manually - which you are.
            now if you rotate the mesh but didnt disable the code, the camera would still be rotated... so make sure that wasn't the case.

            Third, the mesh rotation and camera rotation can be entirely unimportant if you socket the camera to the head bone. Clear the camera transforms, add a spring in between with just enough length to prevent clipping your head through walls. Make sure collision checking is on on the spring.
            The spring has sockets. Socket the camera to the front socket.

            then you can also play with delay lag on the spring/camera for rotations - if that's what sway is for you. For me sway is another word for head Bob. If you socket the camera that's going to happen already. In fact you should figure out what works best for you to provide players an option to remove that altogether.

            Comment


              #7

              Actually, I caught the word sway from other related questions on the internet, sorry for the misuse of it, it's not my native language. But your explanation of the camera delay worked perfectly. Thanks.

              Comment

              Working...
              X