Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

using == is inefficient unity

private void OnCollisionEnter2D(Collision2D Inf) {
// you can use whatever collisiontrigger() you want, i just chose collisionenter2d();
// use comparetag() for tags instead
// remember to only use this for TAGS.
	if (Inf.CompareTag("Tag")) {
    	print("Efficiency enabled!");
    }
}
 
PREVIOUS NEXT
Tagged: #inefficient #unity
ADD COMMENT
Topic
Name
3+1 =