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

Why doesn't this work?

Asked by 8 years ago

This local script is in the starter gui. For some reason the bodyposition position stays at 0,0,0.

wait(1)

BlockCam = Instance.new("Part")
BlockCam.FormFactor = "Custom"
BlockCam.Size = Vector3.new(.2,.2,.2)
BlockCam.Transparency = 1
BlockCam.CanCollide = false
BlockCam.Name = game.Players.LocalPlayer.Name.."'s Cam"
Floater = Instance.new("BodyPosition")
Floater.Parent = BlockCam
BlockCam.Parent = game.Players.LocalPlayer.Character

while wait() do
    Floater.Position = Vector3.new(game.Players.LocalPlayer.Character.Torso.Position)
end
0
You don't need a 'Vector3.new()', because it's already a Vector3 value, so you are doing the equivalent of 'Vector3.new(Vector3.new(0,0,0))' TheDeadlyPanther 2460 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

Referring to my comment above:

You don't need a Vector3.new for a value that is already a Vector3.

So:

Floater.Position = game.Players.LocalPlayer.Character.Torso.Position

-- not:

Floater.Position = Vector3.new(game.Players.LocalPlayer.Character.Torso.Position)
Ad

Answer this question