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: CFraming a model?

Previous Thread :: Next Thread 
Delones is not online. Delones
Joined: 19 Jul 2010
Total Posts: 1703
31 Jan 2014 11:37 PM
How?

Time is a tool you can put on a wall, or wear it on your rizd.
Report Abuse
secretidagent is not online. secretidagent
Joined: 07 Nov 2010
Total Posts: 1600
31 Jan 2014 11:41 PM
You just have to do it brick by brick.
Report Abuse
jd678 is not online. jd678
Joined: 18 Apr 2008
Total Posts: 11529
31 Jan 2014 11:42 PM
Ew, no you don't, it's INSANELY simple, and I'll show you
Report Abuse
Delones is not online. Delones
Joined: 19 Jul 2010
Total Posts: 1703
31 Jan 2014 11:43 PM
:D?

Time is a tool you can put on a wall, or wear it on your rizd.
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
31 Jan 2014 11:43 PM
That's not true. There are plenty of ways to do it using algorithms and methods like ToObject/WorldSpace.
I would suggest using the qCmdUtl plugin, I believe that had a model rotation feature.
Report Abuse
jd678 is not online. jd678
Joined: 18 Apr 2008
Total Posts: 11529
31 Jan 2014 11:44 PM
for i = 1,5 do
ModelPos = MODEL:GetModelCFrame()
newPosition = ModelPos * Vector3.new(0.5,0,0) --Change this to make it faster/slower
wait(0.1)
MODEL:TranslateBy(newPosition - MODEL:GetModelCFrame().p)
end
Report Abuse
jd678 is not online. jd678
Joined: 18 Apr 2008
Total Posts: 11529
31 Jan 2014 11:45 PM
My method is for CFraming an entire model to move in increments.
Report Abuse
Delones is not online. Delones
Joined: 19 Jul 2010
Total Posts: 1703
31 Jan 2014 11:47 PM
How would I move that to the CFrame of one known as 'missile'?

Time is a tool you can put on a wall, or wear it on your rizd.
Report Abuse
jd678 is not online. jd678
Joined: 18 Apr 2008
Total Posts: 11529
31 Jan 2014 11:48 PM
And, Hi MHebes! :D

My favourite scripter on SH :p
Report Abuse
jd678 is not online. jd678
Joined: 18 Apr 2008
Total Posts: 11529
31 Jan 2014 11:49 PM
You could try doing a repeat until they have the same CFrame, but I beleive someone else on SH would have a much better idea.

MoveTo() only works to move the model, not incrementally.
Report Abuse
RobustPhysics is not online. RobustPhysics
Joined: 12 Jul 2012
Total Posts: 3064
01 Feb 2014 12:05 AM
function CFrameModel(model,part)
local center = model:GetModelCFrame()
for _,v in pairs(model:GetChildren()) do
if v:IsA("BasePart") then
local offset = center:inverse()*v.CFrame
v.CFrame = part.CFrame*offset
end
end
end

CFrameModel(workspace.Model,workspace.Missile)


There, that should work fine. And sorry, but I can't really explain this to you. I barely understood it myself after a fair amount of thinking and a bunch of tests XD

(If it doesn't work, try this. Oysi apparently made a good model CFramer: http://www.roblox.com/Model-CFramer-by-Oysi-item?id=55719166)
Report Abuse
jd678 is not online. jd678
Joined: 18 Apr 2008
Total Posts: 11529
01 Feb 2014 12:14 AM
@Rob that won't work, unfortunately I don't really know of a way to do this, all though I know there is one out there.
Report Abuse
RobustPhysics is not online. RobustPhysics
Joined: 12 Jul 2012
Total Posts: 3064
01 Feb 2014 12:23 AM
Hm, just tested it and it worked fine for me. It'll put the center of the model where the Missile is. Even along the same axis the missile is too. Of course, if OP just wanted to move a model by a CFrame value then...

function CFrameModel(model,cf)
local center = model:GetModelCFrame()
for _,v in pairs(model:GetChildren()) do
if v:IsA("BasePart") then
local offset = center:inverse()*v.CFrame
v.CFrame = center*cf*offset
end
end
end

CFrameModel(workspace.Model,CFrame.new(0,-2,0))
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