Why is this possible?

So I playing around with mouse.Hit.p and found that I could move a part…that could move me. Why is this possible? How do I prevent this from moving my character?

robloxapp-20210422-1235118.wmv (1.6 MB)

Sorry about video quality!
Here is the script:

repeat wait() until game.Players.LocalPlayer.Character

local player  = game.Players.LocalPlayer
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
local mouse = player:GetMouse()

local runService = game:GetService("RunService")
local yOffset = Vector3.new(0, 3, 0)

local part = Instance.new("Part")
part.Position = Vector3.new(0, 1, 0)
part.Anchored = true
part.Size = Vector3.new(2,2,2)
part.Color = Color3.fromRGB(53, 255, 225)
part.Parent = game.Workspace

runService.RenderStepped:Connect(function()
	part.Position = mouse.Hit.p + yOffset
end)

Oh this is really simple, just make sure to add the part your mouse is over to the mouse filter.

what is the mouse filter? Is it a property of mouse

Target Filter, my bad

It says that the character is already ignored (does not seem like it).

Or just turn the part CanCollide off?

What if I want it on? What if I was making a tool that the player could move a part for other players to step on?

Then just turn the can collide off for that one player, and turn it on on the server

1 Like

Ig what you could do is make like some hacky stuff by basically raycasting it on your own then adding it to the raycast filter. Now thinking of it they probably want a array of instances to ignore rather than a single instance