Answer the question
In order to leave comments, you need to log in
How to use the OnCollisionStay2D function on another object?
the question seems to be simple.
here is the script.
public void OnCollisionStay2D(Collision2D other)
{
if ( I = 1 )
{
if (other.transform.tag == "Ground") {
OnGround = true;
}
}
if(other.transform.tag == "Ground")
{
//OnGround = true;
body.drag = 10;
jump = true;
}
}
Function works on object on which the script hangs, and it is necessary for me that it was possible to work with another without multiplying scripts.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question