Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How Does :inverse() Work?

Asked by 8 years ago

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

Log in to vote
1
Answered by 8 years ago

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.

Ad

Answer this question