How about ray-casting? It’s a good solution if you have alot of parts like these.
You can make a table of all these parts then cast a ray downwards with whitelist.
If a part gets returned then you’re standing on one of those parts. Only problem with this is, you can only detect parts directly underneath
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local mag = script.Parent.Hitter.Size / 2
while wait() do
if (script.Parent.Hitter.Position - char.HumanoidRootPart.Position).magnitude < mag then
print("yes we're rolling")
else
print("nah we're not")
end
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local mag = script.Parent.Hitter.Size / 2 + 2.5
while wait() do
if (script.Parent.Hitter.Position - char.HumanoidRootPart.Position).magnitude < mag then
print("yes we're rolling")
else
print("nah we're not")
end
end
Instead of making mag half the part size(as you cannot compare size with magnitude) just make it something like 5. Because it has to be close enough so that it’s not impossible to active(the HumanoidRootPart is not located on the players feet, it’s at least 2 studs higher than the feet).
So, if your part height was 1, it would never detect the HumanoidRootPart because it’s too high up.
@lanjtlike I can raycast 200 times a second on my Low End Computer without any performance issues.
If a game is already running bad then they should take care of that, Raycasting, when done correctly and when used in correct situations shouldn’t impact performance.
Sometimes that is out of the developer’s control, and not all people (like new beginners) know how to use raycasting to it’s full performing potential. I’m not arguing about it here but if you’d like to discuss it elsewhere, feel free to do so.
It’s never out of the developer’s control, there are numerous ways to work-around something and virtually anything is possible in game developing. Yes, beginners won’t know how to use raycasting to it’s full potential but that doesn’t mean ray-casting is not a valid option just because they don’t know how to make it work.
Take this very post for example, the OP isn’t sure on how to use the .Touched and .TouchEnded events effectively. It doesn’t mean that using .Touch or .TouchEnded is bad practice.