4
\$\begingroup\$

I made a simple punch animation in Blender and exported it into Unreal Engine 4. In-game, the character appeared from a 3rd-person perspective, but I made it look like first-person by adjusting the camera.

Now, whenever I turn the camera in-game, I can look around at different parts of the character's body. (For example, if I turn right I can see shoulder of my character, and if I am facing the front I can see just the wrists.) Whenever I turn the camera and run the punch animation, it looks weird because the character model isn't aligned with the camera.

How can I make the body turn together with the camera, so my animation looks right?

\$\endgroup\$
  • \$\begingroup\$ What exactly "looks weird"? In reality, if you look in different directions, you'll see different parts of your body. That doesn't sound weird to me at all. \$\endgroup\$ – Anko Sep 5 '15 at 18:12
  • \$\begingroup\$ I think you don't understand. you will see your shoulder if you turn your neck that's true but I mean we don't see our shoulder if we turn our whole body example if your enemys is attacking you from behind so you need to turn back to hit him but when you turn you need to just see your enemy instead you also seeing your hand shoulder because your game camera moves back as it should but your characters body staying rest on same position . so our body blocking us from seeing enemy . while on the play mode when I turn back I can see my characters back .that's because he doesn't turn with camera. \$\endgroup\$ – nirmal Sep 6 '15 at 8:11
  • 1
    \$\begingroup\$ OK, I think I get it! You want the character model to turn together with the camera. I edited to clarify the question. (Feel free to edit more if I missed something.) \$\endgroup\$ – Anko Sep 6 '15 at 11:48
1
\$\begingroup\$

This has been done before in a video tutorial for a "Horror Game". They label it 'True FPS'. Right now it sounds like the mouse movement is moving the camera and not the body. What you want to do is attach the Camera to a Socket on the Skeleton (if you want the camera to move with the animations as well). If not you can just position the camera where you need it, then attach it to a "None" socket when you attach it to the root component or the Skeletal Mesh. The tutorial mentioned is found here. It should give you what you want based on your question.

To be clear, your question is to turn the body with the camera. This answers your question because your turning input will move both the body and the camera. On a technical note though, it is not the body that will turn with the camera, it is the camera that is turning with the body due to the attachment hierarchy. I mentioned this in case you want to have a separate input to cause a Local Transform on just the camera - kind of like in Legend of Zelda: Ocarina of Time where you can use a "Look At / Look Around" function

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.