|
| 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 |
|
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 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 |
|
|
|
| 11 Feb 2014 08:29 PM |
| Oh thanks. I think that is just what I am looking for |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|