I have a model that I need to move between two parts and face where it’s moving. It moves between the parts just fine, but I can’t figure out how to make it face the right way.
Relevant portion of the script.
local StartPoint = workspace.Start
local MoveToPoint = workspace.End
for _, Waypoint in pairs(waypoints) do
local CFrameValue = Instance.new("CFrameValue")
CFrameValue.Value = Model:GetPrimaryPartCFrame()
CFrameValue:GetPropertyChangedSignal("Value"):Connect(function()
Model:SetPrimaryPartCFrame(CFrameValue.Value)
end)
local ToMove = CFrame.new(Waypoint.Position + Vector3.new(0,Height,0)) * CFrame.Angles(End.Position.X,End.Position.Y,End.Position.Z)
local Tween = TweenService:Create(CFrameValue, TweenInfo.new(Time, Enum.EasingStyle.Linear), {Value = ToMove})
Tween:Play()
Tween.Completed:Wait()
CFrameValue:Destroy()
end
When I do local ToMove = CFrame.new(Waypoint.Position + Vector3.new(0,Height,0)) * CFrame.Angles(End.Position.X,End.Position.Y,End.Position.Z)
it faces somewhere, but now where it needs to face.
Everything else I’ve tried either made it spin randomly, or not do anything at all. How would I make it face where it needs to move?