0

I'm making a first person RPG game in unity. So, I have an attack animation but it only attacks what's in front of the character. How can I make the animation based off of where the player is looking (For example, if I look up, the character should attack upward instead of forward)? I've tried attaching the first person camera to the upper part of the body so it would rotate with the camera, but it causes the character's mesh to stretch and distort, and the animation doesn't even work anyway.

By the way, the character is all rigged, has different animations for walking, running, and an attack animation using Unity's mecanim. Everything else works, I'm just having trouble with this attack animation...

4

2 回答 2

0

对于那些仍然想知道的人,我在 LateUpdate() 函数中更改了上半身的旋转。我创建了一个变量来跟踪上次完成的旋转,获取用户输入,然后根据用户输入 + LateUpdate() 中的最后一次旋转旋转上半身并更新最后一次旋转完成。您必须始终旋转最后一次旋转,否则角色会喷出并且上半身不会一直注视正确的位置。

于 2016-07-16T03:10:13.953 回答
0

这些事情主要由您的IK 解决方案完成,您可能想使用全身解算器效应器来为这些类型的动画获得半逼真的运动,您可以使用final-ik,它是一个预制解决方案,或者您可以使用 unity 编写自己的解决方案s ik系统,但它需要很多时间

于 2016-04-27T02:31:11.660 回答