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 relevant to another object, regardless of direction

Previous Thread :: Next Thread 
Spectrabox is not online. Spectrabox
Joined: 29 Aug 2008
Total Posts: 6888
11 Feb 2014 08:03 PM
Lets say I am making an animation system and I always want the arm to be in a raised position and angled to side, like waving to someone. How could I make it so that when my system sets the cframe, it is relevant to the torso say. If it is not relevant to the torso it would just be pointing the same way for a character pointing north and a character pointing west. Any ideas?
Report Abuse
Spectrabox is not online. Spectrabox
Joined: 29 Aug 2008
Total Posts: 6888
11 Feb 2014 08:12 PM
Bump
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
11 Feb 2014 08:18 PM
ObjectSpace
Report Abuse
DaMrNelson is not online. DaMrNelson
Joined: 27 Jul 2009
Total Posts: 4405
11 Feb 2014 08:27 PM
You would multiply how much you want the CFrame to be from the center CFrame. For example:

local part1 -- Define this
local part2 -- And this

part1.CFrame = part2.CFrame * CFrame.new(0, 5, 0) -- part1 will be 5 studs above part2, provided that part2 isn't rotated. Note that by above I mean literally above, not 5 things higher on the Y axis. If the part is at a 90 degree angle, the part will actually be 5 studs in front of it.

Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson
Report Abuse
Spectrabox is not online. Spectrabox
Joined: 29 Aug 2008
Total Posts: 6888
11 Feb 2014 08:29 PM
Oh thanks. I think that is just what I am looking for
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
11 Feb 2014 08:38 PM
Oh, I thought he wanted to find relative CFrame
Report Abuse
DaMrNelson is not online. DaMrNelson
Joined: 27 Jul 2009
Total Posts: 4405
11 Feb 2014 08:46 PM
Nah, I think he had a place he wanted to define a CFrame from.

Just so you know, OP, you can use this to get the position of a CFrame in relativity of another (useful for welding):
local relative = cf1:inverse() * cf2

Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson
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