How do I fix this model positions with a script?
When I clone a model and change its position to a part's, the pivot point is at the part but not the model, how do i fix?
Here is my script:
01 | local RS = game:GetService( "ReplicatedStorage" ) |
03 | local enemiesFolder = RS.Enemies |
04 | local enemySpawn = workspace.EnemySpawns:GetChildren() |
05 | local moveToParts = workspace.MoveToParts:GetChildren() |
07 | local randomSpawn = enemySpawn [ math.random( 1 , #enemySpawn) ] |
08 | local randomMoveToPart = moveToParts [ math.random( 1 , #moveToParts) ] |
10 | local function Round 1 () |
12 | local Round 1 Enemy = enemiesFolder.Enemy 1 :Clone() |
13 | Round 1 Enemy.Parent = workspace.Enemies |
14 | Round 1 Enemy.HumanoidRootPart.Position = randomSpawn.Position |
15 | Round 1 Enemy.Humanoid:MoveTo(randomMoveToPart.Position) |
Thanks for the help!
-KoalaKrush