Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Does anybody know a better hit detection method than "Touched()"?

So I'm making a sword and shield system and one of the main issues I suffer from is people getting hit despite having their shields up.

Does anybody know a better method of doing this than the touched method or do you perhaps know a better way of using Touched()?

4 comments

0

Also this is a animated sword system using roblox's animations.

0

Show us your code please

0

You could have it check if it hit the shield, then if it did hit the shield, have something set to prevent the player from being damaged.

0

I already have that.

1 answer

✓ Accepted answer

I had a similar problem with projectiles bouncing off walls or going through them. I used the runservice and BindToRenderStep and region3 to create a hitbox around the part then detect if something enters it every frame.

http://wiki.roblox.com/index.php?title=API:Class/RunService http://wiki.roblox.com/index.php?title=API:Region3

1 comment

0

I totally forgot about region3! Thank you so very much for your answer!

This discussion is preserved as it was. New answers, comments, and votes are closed.