I’m trying to position and orientate models before adding them to the Workspace. So far I can’t find any method for achieving this.
I tried setting the position and orientation of the models root part and then adding it to the workspace. I tested this using a dummy model.
PrimaryPart is the Head
Red is where I built the model before moving it into ServerStorage, green is where I’m trying to move it to.
Sample script
local serverStorage = game:GetService("ServerStorage")
local Dummy1 = serverStorage.Dummy1:Clone()
local endPosition = Vector3.new(8, 10, -31) --Starting position is (-32, 9, -31)
local endOrientation = Vector3.new(0,90,0) --Starting orientation is (0, -90, 0)
function spawnModel(Model)
local Root = Model.PrimaryPart --Head is being used as the primary part
Root.Position = endPosition
Root.Orientation = endOrientation
Model.Parent = game.Workspace
end
wait(5)
spawnModel(Dummy1)
When the script is executed the model is spawned in at its starting position.
Additional information
I tried using MoveTo() however this function didn’t seem to work untill I added the model to the workspace it also doesn’t allow me to change the models orientation.
This script works when the models primary part is the body (presumably because the body is touching all other parts) but for the purpose I’m trying to acheive the primary part isn’t touching any other part.