generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Move a model?

Previous Thread :: Next Thread 
IDKBlox is not online. IDKBlox
Joined: 05 Apr 2013
Total Posts: 1304
27 Dec 2016 03:23 AM
How would I be able to move a whole model with a script?
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
27 Dec 2016 03:29 AM
Set its PrimaryPart, and then say..

Model:SetPrimaryPartCFrame(CFrame.new(0,0,0)) -- input your own coords


Report Abuse
IDKBlox is not online. IDKBlox
Joined: 05 Apr 2013
Total Posts: 1304
27 Dec 2016 03:36 AM
Thanks man! Now is there a way to make the model go down until it finds ground? if that makes sense.. Well make it where its not floating

This is what I'm using:

Crate:SetPrimaryPartCFrame(CFrame.new(Player.Character.Torso.Position+Player.Character.Torso.CFrame.lookVector*5))
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
27 Dec 2016 03:47 AM
-- you would have to find the bottom-most part of the model. If I were you, I would make an invisible part on the bottom of your crate that you assign to be the PrimaryPart with minimal thickness


ray = Ray.new(Crate.PrimaryPart.Position,Vector3.new(0,-1,0).unit*9999)
part,pos = workspace:FindPartOnRayWithIgnoreList(ray,Crate)
startCFrame = Crate.PrimaryPart.CFrame
distance = (startCFrame.p-pos)

for i=0,distance,1/10000 do
Crate:SetPrimaryPartCFrame(startCFrame:lerp(endCFrame,i)
wait() -- crate gon' fall slow
end


Report Abuse
IDKBlox is not online. IDKBlox
Joined: 05 Apr 2013
Total Posts: 1304
27 Dec 2016 04:56 AM
Thanks Soy!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image