How would I go about making a punch system?

I have decided to create a solo project (im the only person developing it) and I have no idea how to create a fist/punch ability.

  1. What do you want to achieve? I would like to give the player a tool to be able to punch and block. With an idle animation while holding the tool. I keep running into the issue of the players hand just poking out straight and the animation not working, or only working on 1 hand.

  2. What is the issue? I can’t get an idle (holding tool animation) or getting both fits to deal damage. (both fists have a hitbox on them)

  3. What solutions have you thought of so far? I have tried so many YouTube tutorials, and then I had to gulp use some free models. None of the free models worked (obviously).

Can somebody just explain if I need scripts, or other objects to make this work. (its not much of a solo project now huh)
I’m not asking for somebody to make this whole thing for me, but maybe just a shove in the right direction, cause I have not much idea on how to get this working.

Maybe add the scripts you already have to this post.

None of them work though… thats why I am asking! :slight_smile:
They are no where near from working, they only really play sounds. The free models are the closest I have gotten.

Possibly you could add a touched event in the arms and make them take damage. and you can make an animation that plays so when the player touches the arm they can get hurt.

an example would be

local tool = script.Parent -- localscript inside the tool in starterpack
local animation = script.Parent.Animation -- insert an animation to the child of the tool

tool.Activated:Connect(function()
animation:Play()
-- rest of the code here
end) 

EDIT: sorry, I misread your topic. just set the animation type to Action and the animation will override the tool equip animation.

1 Like

I’ve asked a similar titled question before. Here are three things I saw that are usable in a punching system for collision detection:

  • Touched event
  • Magnitude check
  • Raycasting

Touched event is the most popularly used one and should work for you. Your hit box should work fine with Touched unless there’s an error or something wrong?

You can loop an animation to be played when the player equips a tool using the Equipped event and on de-equip, just stop it from playing.

1 Like

you cant play an animation, you need to load it to the humanoid, and then play this loaded animation