Is there anyway to move a Model relative the Model rotation? I tried TranslateBy and MoveTo but it needs Vector3
✓ ANSWER ACCEPTED
Is there anyway to move a Model relative the Model rotation?
1 answer
✓ Accepted answer
Use the model's cframe! Cframes have a special value called LookVector which can be used to move the model "forward"!
local Part = script.Parent
local PPart = script.Parent.Part
Part.PrimaryPart = PPart -- Replace PPart with whatever part you want the primary part of your model to be! This is required!
while wait() do
Part:SetPrimaryPartCFrame(Part:GetPrimaryPartCFrame() + Part:GetPrimaryPartCFrame().lookVector * 3) -- The * 3 is to set the amount of units the model moves
end
This will make the script's parent move in the direction it is facing :)
This discussion is preserved as it was. New answers, comments, and votes are closed.
