Hello,
I am trying to make a NPC walk to a Given Part’s Axis.
When i am testing it in 0,0,0 it walks to the correct Axis,
But when the train turns, it and i need it walk to the Part’s Z Axis, it walks to the Z Axis of the Workspace instead.
How can i make so that it keeps checking the Orientation of the Part, so that it walks to that Axis, i tried many scripts, i have been testing for 2 hours, but nothing worked. This is my Current Script to move the NPC to the Z axis.
Anyone know how to fix this issue?
So that the NPC walks in the Axis of the Part (trainBase), Not the Workspace
local targetCFrame = CFrame.new(npc.HumanoidRootPart.Position.X, npc.HumanoidRootPart.Position.Y, trainBase.Position.Z)
local targetPosition = targetCFrame.Position
humanoid:MoveTo(targetPosition)
humanoid.MoveToFinished:Wait()