- Home /
Detect a collision point, but allow pass through collider.
I have a Unity project in which there is a 2D game world that consists of static circle colliders. The player is dynamic. I need collision point to check whether player's trajectory(path from which he came from) tangent to circle collider or not, so I can't use Trigger. But I also need to allow player pass through collider. How can I solve the problem?
Comment
I am confused why you can't use trigger? Then you could do something like this:
var vector = (other.transform.position - transform.position);
var vector2 = new Vector2(vector.x, vector.y); // Need to ignore z axis
vector2.Normalize();
var pointOfContact = vector2 * this.GetComponent<CircleCollider2D>().radius;
Your answer
Follow this Question
Related Questions
How can I detect a collision point, but allow player to pass through collider. 1 Answer
Cirlce Colliders 0 Answers
Collision returning an error 0 Answers
Collider2D/RigidBody2D not working 1 Answer
Collision with renderer.enabled? 0 Answers