Since models don't have position, or rotation in the properties i don't know i would make a script to move a models position in the workspace.
--basically what i want but with a model Part.Position = Vector3.new(1,3,5)
if somone could explain this to me that would be great!
It is pretty simple.
Since models have a PrimaryPart
, many model functions provided by ROBLOX use this part as reference.
It is the pretty simple. Click on the PrimaryPart
and select the part you want as the primary part. Done!
If you didn't understood, click here
Moves the center of the PrimaryPart to the position you given to it. Any other parts the model contains will follow it. Uses Vector3.new()
game.Workspace.Model:MoveTo(Vector3.new(1,1,1)) - moves the PrimaryPart to 1,1,1
However, since it uses Vector3
, if the position isn't free of any obstacles, the part will be moved on Y axis until a "free" zone is found.
Basically the same thing as :MoveTo(), but ignores any obstacles, and you may rotate it.
NOTE that if you don't set a rotation, it is reset to 0,0,0!. By other side, the rotation input is on radians
and not degrees
!
Uses CFrame.new()
and CFrame.Angles()
game.Workspace.Model:SetPrimaryPartCFrame(CFrame.new(1,1,1)) * CFrame.Angles(math.pi, math.pi/2, math.pi) - moves the PrimaryPart to 1,1,1, and rotation to 180,90,180.
The formula to convert degrees
into radians
is r = math.pi*(d/180)
, in wich d
is the value in degrees, and r
is the value in radians. You could use math.rad()
to convert, but I wouldn't recommend that.
Hope I helped!