I have a code that does not seem to work properly. I have a code on collision that does not seem to work when I use the ampersand but work when I use || operator. For example, When I use this code
I want to have the code collide when two objects at the same time are colliding for the if statement to be true. When I use the || operator, it works, but when I use the operator, it does not work.
You’re checking if the gameObject has both the tags “Metal” and “Wood” at the same time…which is impossible.
What you can do is that you can have collision detection on both your metal and wood object. Then if your object has hit them, your metal and wood object should change a boolean variable to true. When both boolean variables are true, it means your object is touching both the metal and wood objects.