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: explaination of using :inverse()?

Previous Thread :: Next Thread 
EncodedLua is not online. EncodedLua
Joined: 02 May 2012
Total Posts: 1555
28 Mar 2015 09:25 PM
I'm not quite sure why you need to use this when you weld. I know what it means, but why inverse the CFrame coords? Wouldn't it throw off the CFrame?
Report Abuse
EncodedLua is not online. EncodedLua
Joined: 02 May 2012
Total Posts: 1555
28 Mar 2015 09:31 PM
Never mind
Report Abuse
DrMathematica is not online. DrMathematica
Joined: 29 Aug 2008
Total Posts: 27268
28 Mar 2015 09:32 PM
This is why we use better functions for more modern code. There's no need to worry about the inverse of a CFrame using the correct CFrame functions ROBLOX provides.

Weld.C1 = Weld.Part1.CFrame:toObjectSpace(Weld.Part0.CFrame)

Will make Part1 stay where it was at and be welded to Part0 (parent the weld _after_ doing that).

That's a lot easier to understand yeah? If not, here's the simple explanation:

Weld's work in object-space coordinates. That means CFrame.new(0,1,0) is not 0,1,0 in the game. It's 0,1,0 _away_ from another CFrame.

That line there takes Part1.CFrame and turns it into object-space coordinates OF Part0.CFrame.
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
28 Mar 2015 09:33 PM
It basically is the opposite of the cframe, quite like -1 instead of 1.

HOWEVER, CFrame rotations can NEVER BE NEGATIVE, so it just flips the cframe so it looks backwards.
Report Abuse
EncodedLua is not online. EncodedLua
Joined: 02 May 2012
Total Posts: 1555
28 Mar 2015 09:34 PM
So, it basically makes sure that the CFrame is centered. I got it now.
Report Abuse
EncodedLua is not online. EncodedLua
Joined: 02 May 2012
Total Posts: 1555
28 Mar 2015 09:34 PM
At least with tools and welds anyways
Report Abuse
DrMathematica is not online. DrMathematica
Joined: 29 Aug 2008
Total Posts: 27268
28 Mar 2015 09:35 PM
"So, it basically makes sure that the CFrame is centered. "


Um... no
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
28 Mar 2015 09:39 PM
think of it like this


a = 1
b = 5
c = 5 + 1:Inverse()
print(c) -- 4


We do this because we cannot use / or - operators to get the difference between the two cframes.
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
28 Mar 2015 09:39 PM
b + a:Inverse()
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