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 » Scripting Helpers
Home Search
 

Re: Moving a model with CFrame?

Previous Thread :: Next Thread 
sloomingbla is not online. sloomingbla
Joined: 28 Jun 2008
Total Posts: 1109
16 Dec 2013 06:37 PM
wanna move a model through some parts :3
Report Abuse
sloomingbla is not online. sloomingbla
Joined: 28 Jun 2008
Total Posts: 1109
16 Dec 2013 06:41 PM
Basically i was wondering if there is a way to do essentially the same thing as moveto() but using cframe so it can appear inside other parts, go through parts, ect.

if there isnt could i just save the vector3 relative to the position of the other parts?
Report Abuse
sloomingbla is not online. sloomingbla
Joined: 28 Jun 2008
Total Posts: 1109
16 Dec 2013 07:20 PM
Bump :(
Report Abuse
Nyxis is not online. Nyxis
Joined: 15 Nov 2012
Total Posts: 3374
16 Dec 2013 07:32 PM
Toggle Collision Check.
Report Abuse
sloomingbla is not online. sloomingbla
Joined: 28 Jun 2008
Total Posts: 1109
16 Dec 2013 07:43 PM
I'm trying to move a model using a script. i can move it into another part ect easily with roblox studio. was wondering what i have to do to move a model asif i was using cframe, where the model will go exactly where i say regardless of parts there.
Report Abuse
sloomingbla is not online. sloomingbla
Joined: 28 Jun 2008
Total Posts: 1109
16 Dec 2013 08:42 PM
Bump :'(
Report Abuse
sloomingbla is not online. sloomingbla
Joined: 28 Jun 2008
Total Posts: 1109
16 Dec 2013 09:03 PM
Oh. i figured it out. It doesnt work with rotated parts, and you need a part named Base in it, but it works for my needs. for those curious, here ya go:

function movemodel(model,pos)
local r = 0
local list = {}
c = model:GetChildren()
for i = 1,#c do
if c[i].ClassName == "Part" and c[i].Name ~= "Base" then
r = r + 1
list[r] = c[i]
r = r + 1
list[r] = c[i].Position - model.Base.Position
end

end

model.Base.CFrame = CFrame.new(pos.X,pos.Y,pos.Z)

for i = 1,#c do
if c[i].Name ~= "Base" and c[i].ClassName == "Part" then
for m = 1,#list do
if list[m] == c[i] then
print(c[i].Name)
c[i].CFrame = model.Base.CFrame * CFrame.new(list[m+1].X,list[m+1].Y,list[m+1].Z)
end
end
end
end

end
Report Abuse
HAXO is not online. HAXO
Joined: 19 Mar 2010
Total Posts: 690
16 Dec 2013 09:06 PM
Too much code. I can't read all that.

1) Make sure all the parts are anchored.
2) Set the model's parent to nil.
3) Move the model.
4) Set the model's parent to Workspace
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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