Problems with using OnTriggerStay2d
I am having a a very sudden issue with using the OnTriggerStay2D function. I currently have two units that, when they collide, stop moving and deal damage to each other. I have used this method before and it worked as intended.
However, this time the best I can gather is that Unity is only registering the collisions while the who colliders are moving. Once the two units are stationary, they no longer register each other. I've discovered that by increasing and decreasing the size of either collider wile they are touching will register the hits.
I have done some research and seen some people talk about it as a bug. Both objects have rigidbodies, are kinimatic and are triggers. Here is my code, but it feels so simple that i really must be missing something right?
void OnTriggerStay2D(Collider2D col)
{
Debug.Log(col.tag);
isFighting = true;
}
edit: formatting and the isFighting portion of my code is related to the rest of the object, dictating whether or not it can move
Your answer
Follow this Question
Related Questions
Get tile from trigger 0 Answers
OnTriggerEnter2D and OnCollisionEnter2D not working 1 Answer
Does an object need to be a trigger to interact with another one 0 Answers
OnTriggerEnter2D not working 2 Answers
How to make a growing mesh 0 Answers