I somehow broke combat and movement and have no idea how

I completed this course a few months ago, but now that I’m trying to add my own animations and models, both movement animations and combat are broken.

I have no idea where the problem could be, I’ve swapped out models, animations, and controllers dozens of times during this project, but this morning I woke up and my character doesn’t animate while walking, and attack animations do not trigger damage effects anymore.

I don’t know what I could share to help illustrate my point, everything has been working perfectly for months now, but now it simply does not.

I was wondering if anyone had a simple step-by-step explanation of how the movement and combat logic works, and why changing the attack animation may cause hit detection to no longer work? What’s weird is that I did not touch the locomotion blend three at all. I understand that combat broke because I changed the controller and the animation, but I did nothing at all to movement.

To clarify, by “movement” I mean the idle/walk/run blend tree is not working consistently anymore. The character moves, but at seemingly random moments he gets stuck in idle stance. I noticed when this happens, all characters in the scene with the same controller go into idle stance as well. Nothing gets logged and there are no exceptions, so I’m not sure why this is happening.

As for combat, I have absolutely no idea what is even happening. One funny thing I’ve found is that equipping one weapon, the bow specifically, disables every animation across all characters in the scene, and instead of playing the attack animation on the override controller, it plays a random spell casting animation that I do not even have plugged into the animator!

Okay, I’m realizing the animation I’m using doesn’t have any event to call Hit(). This never mattered with other animations ive imported because they never actually needed to call anything, so that’s why I’m seeing it for the first time.

This was probably obvious to others (and was probably even in the video), but just in case someone else has this issue, you can add an event to a read-only animation by making a duplicate and adding an event with Hit as the function.

Most 3rd party animations come in the form of an FBX, which will appear in Unity as a file with an arrow on the side, which expands to show rigs and animations. The animations within this container are indeed read only from the project folder, but if you click on the FBX itself, the inspector should show import settings.


In the import dialogue, click on the Animation tab

Scroll down the animation page until you hit the Events foldout. Then use the preview pane to move hte animation to the point you want the event to occur.


Finally, click the small icon in the Events dropdown with the + symbol, and type Hit in the function, leave the other fields alone.
image

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms