You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want my Region to Detect a Player
What is the issue? Include screenshots / videos if possible!
It does not give an error it just simply does nothing.
This is the script
while wait() do
print("E")
local detectingPlayers = region:FindPartsInRegion3(regionDetectPart, math.huge)
for i, hit in pairs(detectingPlayers) do
if hit.Parent:FindFirstChild("Humanoid") then
print(hit.Parent.Name)
local plrchar = hit.Parent
local player = game:GetService("Players"):GetPlayerFromCharacter(plrchar)
if plrchar:IsA("Player") then
print(player.Name.. "Yeah")
end
if player then
print("It's a player")
end
end
end
end
It does not detect the player but it detects the object around it for example a Dummy.
Also I’ve used the Module name "RotatedRegion3
I had purposely made a 2 check if the Dummy is a Player, but of them does not work.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Yeah but I can’t seem to find a similar one
Please do tell if you have an Idea about this Code.
First of all, I do not understand why you would use regions for detecting a player. I would use a part instead and listen to the Touch and TouchEnded events.
Using regions is quite heavy in terms of performance, since you have to keep checking. Listening to Touch and TouchEnded events is much lighter on your memory usage, since the physics engine will do all the work for you behind the scenes.
Theoretically, you can also use multiple parts at once and/or different shapes.