Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

what in the world happened?[edit]

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

2 answers

✓ Accepted answer

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.

7 comments

0

His problem is that he wants the part to fall. But he is relocating the part once every second

0

That depends on how far dis drop is from the 'void'. From a normal distance, it should be enough time. But wrapping Mouse.Hit in a Vector3 value will result in the coordinates of 0,0,0 which is a huge problem.

0

never heard of the parts welding before

0

I see that specific problem also needed improvement. But the question seemed to revolve around "Why won't the part fall?".

0

Yeah, all depends on where or what is spawns on, assuming the part still has it's inlet and stud surface types.

0

"Well, first of all, when using Mouse.Hit, that already returns a Vector3 value. " I think you meant that Mouse.Hit.p returns a Vector3 value.

0

Yeah, thanks XAXA.

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.