Wyzloc
(Wyzloc)
September 13, 2019, 10:32am
#1
I want to be able to punch someone upside the head and send them flying with perfect aim. What other methods are there to detect hitboxes than raycasting (crazy math), and magnitude (bleh)?
ZacBytes
(Zachary)
September 13, 2019, 11:00am
#2
You could try using Region3 detection
If you want to do like 0 math then you can use the .Touched event but that’s not very reliable
2 Likes
Zooleos
(Zooleos)
September 13, 2019, 11:00am
#3
Using Region3 is quite nice and accurate. I recommend using Egomoose’s module so you don’t have to do a ton of math.
Update: This module has served its purpose, but with the release of the new spatial query API this post is obsolete. It will be left untouched for learning purposes, but it’s strongly recommended to check out the built-in api solution instead.
Recently I took another crack at an old module I wrote some time back. The goal of this module is to provide users with a way to create Rotatable Region 3’s which is useful for too many reasons to list.
Even though this module (older versions) has been …
1 Like
Wyzloc
(Wyzloc)
September 13, 2019, 11:44am
#4
I’ll give that a try zac, thanks!
1 Like
guidable
(guidable)
September 13, 2019, 3:54pm
#5
Mind giving a source for .Touched not being reliable?
ZacBytes
(Zachary)
September 14, 2019, 12:34am
#6
Main Problem
I want to achieve creating parts that play music whenever you touch them. Currently it works, however there are some inconsistencies.
The issues are:
Sometimes, whenever leaving and entering the hitbox, the music will not play.
Whenever jumping, it will call the TouchEnded event, which will stop the music
I have been considering Region3's, however, you will need to detect them through while loops or RunService.Heartbeat. This will be performance heavy whenever having multiple …
There are plenty other cases of touched not working properly
1 Like
Wyzloc
(Wyzloc)
September 14, 2019, 12:35am
#7
Yeah touched is super weird I tried using that to test hitbox and when standing still it’s some garbage.
2 Likes
ZacBytes
(Zachary)
September 14, 2019, 12:37am
#8
Personally I like to use DistanceFromCharacter lol, just set the radius super low to detect a collision
sz_s
(sz_s)
September 14, 2019, 3:52am
#9
Raycasting shouldn’t involve a lot of math, pretty sure Roblox handles all that for you. You just need to specify a starting position and a direction to cast a ray.
@TeamSwordphin described an interesting hit detection system a few threads ago: How to make a perfect hitbox? - #6 by TeamSwordphin
1 Like