mouse = game.Players.LocalPlayer:GetMouse() local e = Instance.new("Part") e.Parent = game.Workspace while wait(1) do e.CanCollide = false e.Anchored = false e.Position = Vector3.new(mouse.Hit.p) print'hi' end
this doesnt work... the print part works fine, but the anchored doesn't do anything. it doesn't fall through the floor, even though its cancollide is false, so why isnt this working? it wont even fall for a second, and thats not what i want it to do, this was just a test to see if the part just freezes in place
Well, first of all, when using Mouse.Hit.p
, that already returns a Vector3
value. Making the use of Vector3.new
redundant.
Welding?
From my experience, sometimes parts can automatically weld
to something depending on where they spawn. I see this as a very rare chance of happening, but a chance nonetheless. If the part is welded to something, it won't fall through other parts while unanchored. However, you should try this solution before you worry about whether or not it's welding:
Solution?
local mouse = game.Players.LocalPlayer:GetMouse() local e = Instance.new("Part",workspace) while wait(1) do e.CanCollide = false e.Anchored = false e.Position = mouse.Hit.p -- Assigning the mouse.Hit vector print'hi' end
If this doesn't work, leave a comment so I can edit the answer with a different solution.
Well, your order of operations is all off.
"while wait(1) do" means once every second it is doing what you tell it to NONSTOP. It is moving the block once a second not allowing it to fall.