Question by
Adrian-Salarda · Apr 28, 2016 at 08:52 AM ·
physics2dcollider2dontriggerstayoverlapsphere
How to write an overlap sphere 2D
Just trying to figure out how to write out a physics.overlapsphere in unity. Haven't used this kind of code yet. Would really appreciate the help, thank you.
void OnTriggerStay2D (Collider2D target) {
target = Physics2D.OverlapCircle (1,7);
if (target.tag == "Player")
{
AttackPlayer ();
}
}
Comment
Your answer
Follow this Question
Related Questions
2d collisions physics not working when using mouse as input 0 Answers
Physics 2D disable collision bouncyness 0 Answers
Can unity dynamically adjust a custom physics outline with animation? 0 Answers
OnTriggerEnter2D() is never being called 0 Answers
Collision: I don't know how to phrase what I am asking for 0 Answers