Question by
Tinyelf75 · Nov 08, 2021 at 05:04 PM ·
colliderscollision detection
Collisions not working right?
So I am currently having ago at making flappy bird in unity. I am very new but am trying not to follow tutorials and just use documentation. I cant get the collisions between the player and the pipes to work correctly. whenever they collide nothing happens. I just want to be able to make something happen when they collide. The player has a Rigidbody2D and a collider on it and the pipes have colliders on them. Here is my code on the pipes: { void OnCollisionEnter2D(Collision2D col) { if (col.gameObject.tag == "Player") { print("hello"); } } }
Comment
Your answer
