Question :ToObjectSpace()

Hello, I’m a little confused after reading some things.

Character.UpperTorso.CFrame:toObjectSpace(Box.CFrame)

if we say something like that, it takes Character.UpperTorso.CFrame as the center of the world and calculates Box’s CFrame accordingly?

2 Likes

This might help.

Just try it and see, if you haven’t seen it in action.

To test it, experiment with the box’s different orientations. Upside down, panned left, etc.

2 Likes

Hello, I’ve seen this, but some people say it differently.

And yes thank you so much LOL.

And yes, when I test it, a different result comes out.

To explain this simply, A:ToObjectSpace(B) returns the relative position from the designated origo, B, of the other position, A.

1 Like

Let’s start off with what WorldSpace and ObjectSpace is.

First of all, they are two different things. (Obviously.)
WorldSpace is relative to the world and ObjectSpace is relative to a specific object.

——-

Let’s say we had two different parts. One named “Red,” one named “Blue.”

Red is stationed at 1,1,1 in WorldSpace. Blue is stationed at 1,2,1 in WorldSpace. If you convert the CFrame of blue into ObjectSpace relative to Red, you will get 0,1,0 because that’s the CFrame based off of the object (red)

——-

I’m bad at explanations and half of this post is probably incorrect. Sorry if it is. :eyes::sweat_smile:

Hope this helps.

1 Like

Ok thank you so much, I got it.