Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is there a way to positionate the model via a script?

I'm asking if I can use a function like CFrame for the whole model ( CFrame isn't working so if there's something else?)

2 answers

✓ Accepted answer

Yes, there is a way to move a whole model just like CFrame. This function's name is SetPrimaryPartCFrame(). There is a function named MoveTo, this also works for models, but just like Positioning (you cannot make parts collide together, this doesn't include parts collided together within the model! )

Now, when you use SetPrimaryPartCFrame() , this function will move the PrimaryPart (required) to the given location in the argument and all the parts in the model will move in relation to that chosen part.

  • Now, how do I set a PrimaryPart? It's simple, look at the code I prepared for you bellow:
game.Workspace.Model.PrimaryPart = game.Workspace.Model.PartA
  • Now, how do I use the function SetPrimaryPartCFrame() ? Look bellow for a script and information!
game.Workspace.Model.PrimaryPart = game.Workspace.Model.PartA -- Make the PrimaryPart so the script can move all parts in relation to PartA
game.Workspace.Model:SetPrimaryPartCFrame(CFrame.new(0,100,0))-- The argument is the CFrame location, in this case it will be at 0,100,0

1 comment

0

Thanks a lot.

Instead of using CFrame, you can use MoveTo to position a whole model. It accepts the Vector 3, such as 1,1,1.

Example:

game.Workspace.Model:MoveTo(Vector3.new(1,1,1))

1 comment

0

Is there any other method you can use to position  Models?

This discussion is preserved as it was. New answers, comments, and votes are closed.