Whenever a slime touched my collider, they get knocked back

How should i fix this?

It sounds like your slimes may be set as ‘Dynamic’ objects under the RigidBody, rather than ‘Kinematic’. If so, then switching them to Kinematic should solve the issue.

1 Like

I would go over the lecture again and see if there is something you missed in the set up or in the code that is causing it to constantly knockback rather than when attacked.

If you need any help please post screenshots of the set up of the player in unity and paste the code here and then select it and click the <> icon to format the code

Let us know how you get on.

1 Like

I don’t know if you are still looking for the answer to this, but I had a similar issue and found out that I forgot to add “DoneAttackingAnimEvent” to the end of the animation of the Sword Swing Up and Down. This is the code that Turns off the collider.

I noticed when testing that when ever i swing the sword the first time in the Hierarchy the Weapon Collider stayed active and never turned off, after making sure the events were added to the animations it now works properly.

2 Likes

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

Privacy & Terms