- Home /
Question by
13yearoldceo · Apr 12, 2015 at 05:15 PM ·
collisiontriggerrigidbody2dphysics2dtag
OnTriggerEnter2D is not working
i even tried it without the tags and used debugs but its still not working both of the objects have rigibodies2d and they are not kinementic so idk what the problem is
void OnTrigger2DEnter(Collider2D other){
if(other.gameObject.tag == "player");{
charge = true;
}
}
Comment
check your title, you wrote OnTriggerEnter2D is not working, but in your code, you're using OnTrigger2DEnter. Simply fix the function name and make sure the collider you have on your GameObject is set to Trigger.
Best Answer
Answer by Limesta · Apr 12, 2015 at 05:19 PM
You put OnTrigger2DEnter when you had meant to put OnTriggerEnter2D.
We all miss the smallest things! Always helps to have another set of eyes!
Your answer
Follow this Question
Related Questions
Rigidbody2D.velocity out of controll 3 Answers
Drag Player Object using Physics 2D 0 Answers
Trigger won't recognise tag 1 Answer
Weird 2d collision behaviour 1 Answer