hi, i was making a game when i noticed a problem. I wanted to make a script that changed the position of a model, but where I know the only way to move a model is to change the “Origin Position”, but I don’t know how to put in the script because has space and can’t put something in script with space.
Example script:
how to put the "Origin Position"
V
game.Workspace.Model.??? = Vector3.new(x,y,z)`
I can’t put:
game.Workspace.Model.Origin Position = Vector3.new(x,y,z)
Because have space.
Does anyone know how to put the “Origin Position” in the script?
local Parent = script.Parent
local Ball = workspace.ball
while true do task.wait()
Parent:MoveTo(Vector3.new(
Parent.Position.X,-- i need to put the Origin Position
Ball.Position.Y,
Parent.Position.Z-- i need to put the Origin Position
))
end
I need to find out the Origin Position of the model anyway.
I believe the way you can get a model’s origin position is by Model:GetPivot() (which is a CFrame). So if you wanted a model’s position on the x-axis it would be Model:GetPivot().Position.X