Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 7 years ago

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()?

0
Also this is a animated sword system using roblox's animations. LordProxius 17 — 7y
0
Show us your code please BlackOrange3343 2676 — 7y
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. TheeDeathCaster 2368 — 7y
0
I already have that. LordProxius 17 — 7y

1 answer

Log in to vote
0
Answered by
Voltoxus 248 Moderation Voter
7 years ago
Edited 7 years ago

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

0
I totally forgot about region3! Thank you so very much for your answer! LordProxius 17 — 7y
Ad

Answer this question