Be the first to post for 'Trigger Player Hit Animation'!

If you’re reading this, there probably aren’t very many posts yet. But don’t worry, you can be the first! Either create a new post or just reply to this one to say ‘hi’.

BY FAR one of the most exciting lectures to get to! Nothing has been more satisfying than clicking on the enemy and seeing your playing swing his mighty battle axe and as @Rob would put it “Bonking Ethan on the head!”

1 Like

I just had an error pop up.

For some reason I’m getting the “‘Player’ AnimationEvent ‘Hit’ has no receiver! Are you missing a component?” error on Runtime. I doubled checked the Weapon.cs code and it looks correct when compared to the GitHub repo. Whats weird is that it was working fine, i took a break, and came back and now I’m getting the error.

I have tried both the RPG animations in the lecture and free ones I downloaded from the asset store.
https://www.assetstore.unity3d.com/en/#!/content/35320

Does anyone have suggestions on how I can debug this? I am at a loss.

Have a nose at the animations… look for a little white vertical bar on the animation timeline, that’s the event.

Thx @Rob

I found the event bar in the animation clip but now I’ve run into a bit of a quandry with the next step. When I click on one of the RPG animations that YOU downloaded I can click edit in the inspector and go down to events and see the HIT event.

I downloaded some cool melee animations from the asset store from here…://www.assetstore.unity3d.com/en/#!/content/35320

When I choose one of these animations in the inspector, there is no edit button. It says Open, but nothing happens. I noticed this disclaimer on their asset store page which may be the root cause.

“Notes: This package contains .anim format animations. The .anim format in Unity cannot be edited, spliced into multiple animations or exported. For editable animations in .fbx format please visit us at Mixamo!”

Hi,

You’re welcome :slight_smile:

I’ve not come across this specific issue myself, but then I haven’t really pulled anything from the Asset Store.

I just did a quick Google search and came across this old article on the Mixamo website;

It does seem to suggest the use of their Unity plugin, but I think that is primarily for purchasing an animation. They seem to duplicate the animation and then can edit it.

Hope this helps.

I have a bug with my animation. I am getting the error animator is not playing an animatorcontroller unityengine.animator:setfloat(string, single). When I click an enemy it plays the animation till the end but then he is stuck in a recoil endstate of the animation and glides slowly along the floor and freezes in that pose. I can only fix by clicking the trigger twice more in the animator tab

1 Like

Mine mostly works, except: 1) when I wander, the weapon flies out of my character’s arm briefly as he moves and swings his arms, even though I set the weapon grip pretty carefully. 2) if an enemy is behind me and I click on him, I swing without facing him. Calling the LookAt function with my transform to the enemy’s transform almost fixes it, but even when looking at the enemy, my swing seems slightly to the side.

click in an animation, look at the inspector, oper ‘event’ and delete the “hit”

Privacy & Terms