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: CFrame Offset

Previous Thread :: Next Thread 
Ethancomputermad is not online. Ethancomputermad
Joined: 22 Feb 2010
Total Posts: 533
17 Nov 2012 08:10 AM
This is intended to simulate a weld by moving part B to part A constantly considering an offset that was set at the start, can anyone see why it is not working?

p = CFrame.new(a.Position)
while true do wait()
b.CFrame = a.CFrame * CFrame.new() * b.CFrame:inverse() * (p):inverse()
end
Report Abuse
Ethancomputermad is not online. Ethancomputermad
Joined: 22 Feb 2010
Total Posts: 533
17 Nov 2012 08:39 AM
bump
Report Abuse
Ethancomputermad is not online. Ethancomputermad
Joined: 22 Feb 2010
Total Posts: 533
17 Nov 2012 08:49 AM
bump
Report Abuse
Ethancomputermad is not online. Ethancomputermad
Joined: 22 Feb 2010
Total Posts: 533
17 Nov 2012 09:31 AM
anyone?
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
17 Nov 2012 10:44 AM
First, you never defined a.
Second, while wait() do will work better if you're just going to put while true do wait()
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
17 Nov 2012 11:01 AM
This is how a weld would work:

local a, b = Workspace.a, Workspace.b
local os = a.CFrame.p - b.CFrame.p
while true do
wait()
b.CFrame = a.CFrame * CFrame.new(-os)
end
Report Abuse
Ethancomputermad is not online. Ethancomputermad
Joined: 22 Feb 2010
Total Posts: 533
17 Nov 2012 12:04 PM
Thanks
Report Abuse
Ethancomputermad is not online. Ethancomputermad
Joined: 22 Feb 2010
Total Posts: 533
17 Nov 2012 12:27 PM
How could I have it also include rotation?
Report Abuse
Ethancomputermad is not online. Ethancomputermad
Joined: 22 Feb 2010
Total Posts: 533
17 Nov 2012 12:42 PM
bump
Report Abuse
Ethancomputermad is not online. Ethancomputermad
Joined: 22 Feb 2010
Total Posts: 533
17 Nov 2012 01:03 PM
...
Report Abuse
Ethancomputermad is not online. Ethancomputermad
Joined: 22 Feb 2010
Total Posts: 533
17 Nov 2012 01:25 PM
I tried
local rx, ry, rz = part1.CFrame:toEulerAnglesXYZ() - part2.CFrame:toEulerAnglesXYZ()
local rotation = CFrame.Angles(rx, ry, rz)
Report Abuse
Ethancomputermad is not online. Ethancomputermad
Joined: 22 Feb 2010
Total Posts: 533
17 Nov 2012 01:25 PM
But that did not work
Report Abuse
Ethancomputermad is not online. Ethancomputermad
Joined: 22 Feb 2010
Total Posts: 533
17 Nov 2012 01:31 PM
I just tried
local rx, ry, rz = part1.CFrame:toEulerAnglesXYZ()
local rotation = CFrame.Angles(rx, ry, rz)
local rx2, ry2, rz2 = part2.CFrame:toEulerAnglesXYZ()
local rotation2 = CFrame.Angles(rx2, ry2, rz2)
local rot = rotation - rotation2
Still nothing
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