Jump to content
  • 0

Help with change in default attack animation.


Blinkuz

Question

As the title says I am needing help regarding a custom change for my project in the source code that handles the animations part specifically in the UpdateSpriteAnimation() method of the client Entity.cs file, see the details in the next paragraph.

 

I need to change the attack animations between a punch and a kick Randomly, I have created the code that is marked in red to test but I see that when pressing the attack key the code to assign the spriteAnimation is executed 2 times and the attack animations overlap, see the code:

 

Spoiler

unknown.png

 

 

My attack animations have 2 frames:

Spoiler

unknown.png

unknown.png

 

Some people from the community discord server have mentioned to me that it may be related to the movement speed of the player and the attack speed that is causing the animation to run 2 times, here I leave the configuration of both speeds of my player:

 

Spoiler

unknown.png

 

unknown.png

 

 

Any recommendation ? I think the problem may be related to my condition to check if it is attacking but I'm not sure.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

I think my problem is related to the attack speed but it is very strange because you only see 1 hit to do damage, although apparently in the source code the part of updating the basic animations is independent of the method that applies the damage, I was wondering if there is any way to be able to condition that if the current state of the player is attacking regardless of whether he is in motion or not, omit the assignment of new sprites to the animation.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...