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

How do I position a model?

3 answers

There are 2 ways to position a model:

Model:MoveTo(Vector3)

Model:SetPrimaryPartCFrame(CFrame)

MoveTo(Vector3) This basically moves the model to the position specified in "Vector3". The good thing about this method is that the Model doesn't need to have a defined PrimaryPart. The bad thing about this method is that you can't rotate the model and you can't position the model within another model.

SetPrimaryPartCFrame(CFrame) This basically changes the CFrame of the model according to "CFrame". The good thing about this method is that you can position the model within other models and you can rotate it anyway you want. The bad thing about this method is that you need to have a PrimaryPart defined, and it doesn't CFrame the model based on the model's center, but rather based on the PrimaryPart's center.

Hope this helped!

3 comments

0

Thanks! I have an NPC Model that I need to move about and such when cloning it through a while loop, will it be able to do that? (Goes to test :P)

0

If you want to move an NPC, I would suggest using :MoveTo()

0

I'm not moving it just placing it at random points like I'd do with a part, while wait() do x:Clone() x.Position = Vector3.new(randomX, randomY, randomZ) end ye it's not correct don't point it out it's quicker than typing it all but yea you get the gist :P

First there isnt a way to position a model like your doing. But... just use Roblox Tools to move the Model. Thats the only way it will work.

1 comment

0

I never provided code to how I was positioning it? And GetModelCFrame is getting the Model's CFrame not setting it, I just can't find any way to position a model in my part/model generation code.

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