I want so tween would rotate the “arrow” part correct way. See attached video.
As you can see, the arrow is rotating but in wrong direction, something that a person would describe as a “360 NoScope”. I have tried googling, scrolling devforum for an hour, but still nothing.
Script
local function getOrien(target: BasePart): Vector3
local orien: Vector3
if target.CFrame.LookVector.X > 0.5 then
orien = Vector3.new(0, 0, 0)
elseif target.CFrame.LookVector.X < -0.5 then
orien = Vector3.new(0, 180, 0)
end
if target.CFrame.RightVector.X < -0.5 then
orien = Vector3.new(0, -90, 0)
elseif target.CFrame.RightVector.X > 0.5 then
orien = Vector3.new(0, 90, 0)
end
return orien
end
local playArrow = function()
arrow.Transparency = 0
arrow.Position = Path["1"].Position
arrow.Orientation = Vector3.new(0, 180, 0)
for i, v in Path:GetChildren() do
local target: BasePart = Path[i + 1]
local posit = Path[i].Position
local orien = getOrien(target)
if i == 5 then
tweenServ:Create(arrow, tweenTransp, {Transparency = 1}):Play()
end
tweenServ:Create(arrow, tweenPosit, {Position = posit}):Play()
task.wait(0.5)
tweenServ:Create(arrow, tweenOrien, {Orientation = orien}):Play()
task.wait(0.15)
if i == 7 then
task.wait(1)
break
end
end
end
It’s pretty funny though LOL, you should leave it in as a “feature.”
Jokes aside, I think that it’s because rotating from y 180 to y -90 requires a 270 degree turn, I would do math like adding 90 degrees or 180 degrees to the current rotation rather than having a set rotation