it just makes the Target go to (0,0,0)
This is strange I'm pretty sure I'm doing it right.
All the names are correct no misspelling.
local Pos1 = Vector3.new(script.Parent.Posi1.CFrame.p) local Pos2 = Vector3.new(script.Parent.Posi2.CFrame.p) local Brick = script.Parent.Target for ratio = 0,1,0.1 do local NewPosition = Pos1:lerp(Pos2, ratio) Brick.Position = NewPosition wait() end
I believe this is your problem :
Vector3.new(script.Parent.Posi1.CFrame.p)
Essentially what you are doing is Vector3.new(Vector3.new()). CFrame.p is already a Vector3. Try doing this:
local Pos1 = script.Parent.Posi1.CFrame.p local Pos2 = script.Parent.Posi2.CFrame.p local Brick = script.Parent.Target for ratio = 0,1,0.1 do local NewPosition = Pos1:lerp(Pos2, ratio) Brick.Position = NewPosition wait() end
You question has already been answered, script.Parent.Posi1.CFrame.p
is already a Vector3, so wrapping it in Vector3.new()
is unnecessary.
Further testing indicates that Vector3.new()
completely ignores non-Number arguments. What's strange is that it will use them as placeholders:
Vector3.new(false, "bool", 152) --> 0, 0, 152 Vector3.new(true, 14) --> 0, 14, 0 Vector3.new(15, Instance.new("Part"), 28) --> 15, 0, 28
This is in line with Vector3 actually having four constructors:
Vector3.new() --> 0, 0, 0 Vector3.new(x) --> x, 0, 0 Vector3.new(x, y) --> x, y, 0 Vector3.new(x, y, z) --> x, y, z
This is definitely a ROBLOX bug, thank you for finding it, Exsius!
Locked by adark and Perci1
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?