• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML General GMS-Noobie question about hit animations [SOLVED]

S

sheixi

Guest
Hello!
I've been trying to get into gamemaker studio by making a simple character that will point towards my mouse and hit on click.

everything worked out fine except that i seem to have chosen an inefficient way of doing that:

i created 2 objects:
1. char
2. hit

i programmed it so that when i click, my character would spawn the object hit on his position which then would follow my char and turn in an arch around him (was supposed to be a sword).

so my problem is, while moving the sword would slightly lagg behind, which led me to believe that this is not the way to do it.

so my question is:
how would this "usually" be done? do i just add frames with the sword to my char and use them when i hit or do i replace the sprite and if so, is there a way to differenciate between collision in different areas of the collision box

I hope this post is in the right forum. this is my first post.

thank you in advace :)
 

StormGamez

Member
a better way to do it would be to make a attack animation for the player that has the sword and then switch to that animation when you click and back to idle or running sprite/animation when the attack animation finishes, then you just create a object in front of the player that is invisible that damages the enemy then disappears afterwards... i hope this helps!
 
Top