Cf * CFrame:inverse() and CFrame:ToObjectSpace(cf) returning different values?

Hello! I have a script to move the player with the object they are standing on. However, I’ve noticed a strange inconsistency with CFrame:ToObjectSpace(cf). When swapping out a simple cf * CFrame:inverse() with this, something goes wrong and the character begins flying off.

Using cf * CFrame:inverse():

And using CFrame:ToObjectSpace(cf):

The reason I’m asking this is because the first method seems to cause drifting when standing still, most likely due to floating point error, so I want to swap it out with this. If anyone has any ideas as to why this inconsistency is here, please let me know!

Thanks

Another note: look at the output in the second video: it prints whether the values of both methods are the same or not.

Are you sure the equivalent isn’t cf:ToObjectSpace(CFrame)?

(CFrame:ToObjectSpace)

I’ve tried that as well. Both seem to result in very exaggerated unpredictable movements

inverse() and ToObjectSpace() arent static functions. they are methods, so they require a cframe thats already initialized. i think roblox will just uses a zeroed out cframe if you call methods like if they were static

also im pretty sure cframes are like matrices, so multiplication order matters. cf * inverse() is different from inverse() * cf

instead of CFrame:inverse() or CFrame:ToObjectSpace() it should be cf:inverse() and cf:ToObjectSpace() where “cf” is the cframe you want to get the inverse of, or turn another cframe into its object space

Ahhhh okay, i’ll give that a try
Just to clarify, cf and CFrame were just two names I gave to them, I’m not using empty values