iSymon
|
  |
| Joined: 19 Nov 2011 |
| Total Posts: 1023 |
|
|
| 21 Jan 2017 04:29 PM |
| so toObjectSpace returns the difference of two CFrames. i.e: print(CFrame.new(-5, 5, -1):toObjectSpace(CFrame.new(-10, -5, -1))) > -5, -10, 0, 1, 0, ##### ## ## ##### # I'm still a bit confused though, can someone kinda defined object and world for me? (I'm a noob) #code local life = nil print(life) |
|
|
| Report Abuse |
|
|
iSymon
|
  |
| Joined: 19 Nov 2011 |
| Total Posts: 1023 |
|
|
| 21 Jan 2017 04:31 PM |
| Wow, censored numbers? so toObjectSpace returns the difference of two CFrames. i.e: print(CFrame.new(-5, 5, -1):toObjectSpace(CFrame.new(-10, -5, -1)).p) > -5, -10, 0 I'm still a bit confused, can someone define object and world for me? (I'm a noob) ^ Fixed the #### ##### local life = nil print(life) |
|
|
| Report Abuse |
|
|
iSymon
|
  |
| Joined: 19 Nov 2011 |
| Total Posts: 1023 |
|
|
| 21 Jan 2017 04:32 PM |
omg...last time
print(CFrame.new(-5, 5, -1):toObjectSpace(CFrame.new(-10, -5, -1)).p)
> -5, -10, 0
#code local life = nil print(life) |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2017 04:53 PM |
"object space" just means coordinates relative to the given CFrame. So if you say "I am 5 miles north of my house", that would be "object space", and if you use toWorldSpace, it would become "I am at x degrees longitude, y degrees latitude." (World coordinates)
They aren't distinctly different in Roblox, they're both CFrames, but using ToObjectSpace takes one CFrame and pretty much subtracts the other to get the relative offset (Or difference between them, or distance or whatever you call it). ToWorldSpace is the opposite, it will take two CFrames, and pretty much adds them. (I won't go into details about what it does for rotation because though it doesn't add rotation, it's essentially the same outcome - it rotates it relative to the other one)
|
|
|
| Report Abuse |
|
|
iSymon
|
  |
| Joined: 19 Nov 2011 |
| Total Posts: 1023 |
|
|
| 21 Jan 2017 05:03 PM |
@JarodOfOrbiter, thanks. The way you elaborated it answered all my questions.
#code local life = nil print(life) |
|
|
| Report Abuse |
|
|
| |
|
|
| 21 Jan 2017 05:14 PM |
toWorldSpace is CFrame.new(cframe.p+cf.p)*(cframe-cframe.p)*(cf-cf.p) (cframe:toWorldSpace(cf)) toObjectWorld is CFrame.new(cframe.p-cf.p)*(cframe-cframe.p)*(cf-cf.p) (cframe:toObjectSpace(cf))
|
|
|
| Report Abuse |
|
|