I'm trying something new and creating a melee combat system to see if I can accomplish a decent fighting system.
I do know that you can use a .Touched event to detect punches or kicks but I know that is extremely unreliable in fighting games because of the delay it can have, and I'm considering incorporating ray casting. I don't know much else, since I've never done this type of thing before.
I'm not asking for a fully fledged script, all I want is some basic tips on how to design combat to be as smooth as possible.
I will suggest you use these five tips :
use .Touched, make the player hitbox bigger to make up for the delay, use transition animations. also try making a cooldown animation, moar particle effects to hide the bad animations.
try using delays in the function , use raycasting to find who you're hitting, try making a level system to make it better, for smoothness try making the place as NOT laggy it can get. for the delay, make it so its 1/2 of the move use time.
try making a priority system to let the system run smoother, like this one:
local priority = nil local punch = 1 local block = 5 local kick = 10 function determine(punch,kick,block) punch = punch + 2 kick = kick*kick block = block + block if (punch >= kick && kick >= block) // do what you want to do punch = 1 end if (punch >= kick && kick >= block) // do what you want to do punch = 1 end if (punch >= kick && kick >= block) // do what you want to do punch = 1 end end
4.try computing how much time do you need to do the move, and make the animation that long.try using a tiny block that tracks where the hand is at( or foot ),that kills anyone that touches it except the LocalPlayer.
5.make a hurt hitbox for every move,if anyone except the LocalPlayer touches it,it hurts them. as incapaz stated above:" you could check if the part that touched it and if the attacker then take damage. and a bool value in the attacker that is set to true when the animation is set".