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: Can you "anchor" a model?

Previous Thread :: Next Thread 
ScriptOn is not online. ScriptOn
Joined: 22 Aug 2010
Total Posts: 10885
26 Jan 2013 07:34 PM
[ Content Deleted ]
Report Abuse
Defaultist is not online. Defaultist
Joined: 25 Jan 2013
Total Posts: 44
26 Jan 2013 07:37 PM
Maybe using some kind of function like findFirstChild to the model, then anchoring parts with it.
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
26 Jan 2013 07:37 PM
Erm for loop?
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
26 Jan 2013 07:38 PM
local model = Workspace.Thingy:GetChildren()
for i,v in pairs(model) do
if v:IsA("Part") then
v.Anchored = true
end
end
Report Abuse
ScriptOn is not online. ScriptOn
Joined: 22 Aug 2010
Total Posts: 10885
26 Jan 2013 07:38 PM
[ Content Deleted ]
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
26 Jan 2013 07:39 PM
Your title does not relate to the subject, so I'll answer both.

Title answer:

    for i,v in pairs(Workspace.Model:GetChildren()) do
      if v.ClassName == "Part" then
        v.Anchored = true
      end
    end

Subject answer:

    Workspace.Model:MoveTo(Vector3.new(0,0,0)
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
26 Jan 2013 07:39 PM
Well in that case idk. unless you are just moving a model not rotating it you could use "TranslateBy()"
Report Abuse
ScriptOn is not online. ScriptOn
Joined: 22 Aug 2010
Total Posts: 10885
26 Jan 2013 07:40 PM
[ Content Deleted ]
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
26 Jan 2013 07:40 PM
    Workspace.Model:Moveto(Vector3.new(0,0,0))
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
26 Jan 2013 07:41 PM
Yea not sure how to do that.
MoveTo uses Vector3, not CFrame.
So idk.
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
26 Jan 2013 07:44 PM


local mod = Workspace.Thingy:GetChildren()

for i,v in pairs(mod) do
if v:IsA("Part") then
v.CFrame = v.CFrame * CFrame.Angles(0,math.pi/2,0)
end
end
Report Abuse
Defaultist is not online. Defaultist
Joined: 25 Jan 2013
Total Posts: 44
26 Jan 2013 07:47 PM
Wait yeah it was GetChildren not findFirstChild..
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