Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How Does :inverse() Work?

So I am scripting right now and trying to understand how does this work: weld.C0 = part1.CFrame:inverse() * part2.CFrame Please explain it to me.

1 answer

✓ Accepted answer

You could say inverse negates the matrix, so when you multiply it with regular matrix, they would sort of 'subtract'. If you are really interested how exactly that works, you can just search matrix inversion.

What happens in this situation, you find out the object space coordinates of part2. This means that you know the part2's offset from part1. If you understand vectors, it would be similar logic to:

part2.Position - part1.Position

I hope it is bit more clear, although this is bit complicated subject.

This discussion is preserved as it was. New answers, comments, and votes are closed.