Answered by
8 years ago Edited 8 years ago
The reason you have to use the MoveTo
function, rather than being able to directly set a Position
property is simple. Your zombie is a model! :D Models do not have the Position Property; therefore, you have to move it using a function.
Functions that can be applied to move models include:
I assume you already know how this is used, since you're using it.
1 | model.PrimaryPart = model [ 1 ] |
2 | model:SetPrimaryPartCFrame(model:GetPrimaryPartCFrame() * CFrame.new( 0 , 10 , 0 )) |
This moves the center of the PrimaryPart to the given position. The model's PrimaryPart Property must be set prior to using the function. The code above would move the model 10 studs up.
1 | model:TranslateBy(Vector 3. new( 0 , 10 , 0 )) |
This shifts a model using a given offset. The code above would, again, move the model 10 studs up.
The only way to move a model entirely through code, without using a function, is to weld the entire model to one specific part inside it. After everything is welded you can set the CFrame Property of that specific part to move the entire model.