How Would You Create Sword Combat?
JoshKahane
Member Posts: 470
Hi
As my character won't be shooting anything, its all sword combat in my game. How you you go about making it so that for example after 4 hits with a sword the enemy actor died?
The player would have to come into proximity of the enemy, then somehow hit them 4 times to bring their health down to 0 which is when they get destroyed. I have all attacking animations in place, but interaction. I have thought of a few things but I was wondering what your opinion was, thanks.
The best way I thought was still have an actor spawn and shoot like a gun (only it would be invisible so it looks like the sword is doing it), only that would slow performance down spawning and destroying actors all over the place.
As my character won't be shooting anything, its all sword combat in my game. How you you go about making it so that for example after 4 hits with a sword the enemy actor died?
The player would have to come into proximity of the enemy, then somehow hit them 4 times to bring their health down to 0 which is when they get destroyed. I have all attacking animations in place, but interaction. I have thought of a few things but I was wondering what your opinion was, thanks.
The best way I thought was still have an actor spawn and shoot like a gun (only it would be invisible so it looks like the sword is doing it), only that would slow performance down spawning and destroying actors all over the place.
Comments
Hope that makes sense.
As you are experimenting with this I would leave the invisible actor visible until it works right. Then uncheck the visible box in the player's attributes.
rule (ALL)
1) when actor collides with invisible sword
2) when game.stab is true
Destroy this actor
change game.score to game.score+1
etc....
Then have the animation in the main player and it will look like he stabbed the bad guy but really the sword was always there but it gets "activated" when the button is pressed.
Rule:
When overlap or collide with hero actor
Every 1 sec
Change attribute self.HP to self.Hp -1
When HP = or < 0
Destroy Actor
This works for melee range. Try this & let me know what happens. Technically it should work. The only reason it might not is if GS doesn't consider the 2 units touching as collision.
-JGary