Evgeniy Simakov
Evgeniy Simakov
@Toqozz, hi! Thank you very much for code samples, your collision handling approach is very useful. But there are solutions only for two types of colliders - CircleCollider2D and BoxCollider2D....
Does ClosestPointOnLine function looks like this? Or is there some specificity? I didn't find the implementation in your comment. ``` Vector3 ClosestPointOnLine(Vector3 a, Vector3 b, Vector3 p) { return a...
``` public static float2 ClosestPointOnLine(float2 v1, float2 v2, float2 p) { float l2 = math.distancesq(v1, v2); // v1 == v2 case. if (l2 == 0f) { return v1; //math.distance(p, v1);...
Hmm, yeah, you're right, sorry. I was confused by the documentation of the math package: v 1.0:  https://docs.unity3d.com/Packages/[email protected]/api/Unity.Mathematics.math.html#Unity_Mathematics_math_distancesq_Unity_Mathematics_float2_Unity_Mathematics_float2_ v 1.2:  https://docs.unity.cn/Packages/[email protected]/api/Unity.Mathematics.math.distancesq.html#Unity_Mathematics_math_distancesq_Unity_Mathematics_float2_Unity_Mathematics_float2_ Anyway, are you using mathematics package and...