Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 9 years ago

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

Log in to vote
1
Answered by 9 years ago

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
0
Thanks a lot. brokenrares 48 — 9y
Ad
Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
9 years ago

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))
0
Is there any other method you can use to position  Models? UserOnly20Characters 890 — 9y

Answer this question