1
1
123 1232018-03-19 19:12:43
Unity
123 123, 2018-03-19 19:12:43

How to get local coordinates of collision?

There is object 1 and 2, object 1 is in contact with 2, I need to find out the local coordinates of the collision site on object 2. I only found how to find out the world coordinates.
PS: Collision2D

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2018-03-19
@JustFool

https://docs.unity3d.com/ScriptReference/Transform...

var localPosition2 = object2.transform.InverseTransformPoint(collision.position);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question