I was gonna say that.
If tool of a Player Touches, you can still get Player, by checking Parent, until you get Humanoid, Or if you don’t want Tool to work; than don’t flip the debounce on Tool…
I’ve used Touched and .magnitude, but don’t know Region3, and Yes, I’ve read there is a new Method for Region, also…
.Magnitude is pretty-well the same as Region, except a sphere (or a cylinder of infinite height, if you strip the Y value), instead of a box…
I’m pretty sure doing the checks constantly wouldn’t be good, so to avoid harming performance I start the checks either when a box is placed or when the player touches the pad, and after the area becomes clear the checks stop, so as long as you don’t leave too much boxes on the pads it shouldn’t cause any performance issues.
I found a solution!!
For the lag issues i will just disable the buttons of the rooms the player is not in.(Single player game)
Here is it in studio:
And here is the script:
local TweenService = game:GetService("TweenService")
-----000000000-----
local Collider = script.Parent.Collider
local Value = script.Parent.IsPressed
local Pusher = script.Parent.Pusher
-----000000000-----
local OriginalPosition = Pusher.Position
-----
local GoalPressed = {}
GoalPressed.Position = OriginalPosition - Vector3.new(0,0.25,0)
-----
local GoalReleased = {}
GoalReleased.Position = OriginalPosition
-----
local TweenInformation = TweenInfo.new(
0.25, -- Duration of the tween in seconds
Enum.EasingStyle.Sine, -- Kind of easing to apply
Enum.EasingDirection.In, -- Direction of the easing
0, -- Times the tween is repeated
false -- If the tween is gonna reverse
)
-----
local PressTween = TweenService:Create(Pusher, TweenInformation, GoalPressed)
local ReleaseTween = TweenService:Create(Pusher, TweenInformation, GoalReleased)
-----000000000-----
while wait(0.2) do
local PartsTouching = game.Workspace:GetPartsInPart(Collider)
if #PartsTouching ~= 0 then
print("Press")
Value.Value = true
PressTween:Play()
elseif #PartsTouching == 0 then
print("Release")
Value.Value = false
ReleaseTween:Play()
end
end