Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

what in the world happened?[edit]

Asked by 8 years ago
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

Log in to vote
3
Answered by 8 years ago

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.

0
His problem is that he wants the part to fall. But he is relocating the part once every second BSIncorporated 640 — 8y
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. ScriptGuider 5640 — 8y
0
never heard of the parts welding before ScriptsAhoy 202 — 8y
0
I see that specific problem also needed improvement. But the question seemed to revolve around "Why won't the part fall?". BSIncorporated 640 — 8y
View all comments (3 more)
0
Yeah, all depends on where or what is spawns on, assuming the part still has it's inlet and stud surface types. ScriptGuider 5640 — 8y
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. XAXA 1569 — 8y
0
Yeah, thanks XAXA. ScriptGuider 5640 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

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.

Answer this question