- Home /
Unity2D collider of children object always hits in the same direction even after being flipped.
Alright, I have my character GameObject which has some scripts and a child that is the laser. When I press a key, the laser is SetActive to true and then to false some seconds later in code. This code already works, but I seem to be having problems with the collider. If I look through the Scene view with my laser selected, I can see it is flipped when my character is facing in the other direction. But somehow, it always hits to the right (initial facing direction).
In this example, the boss gets hit by the laser if the character is close enough to get hit from the initial direction of the laser. In the second image, the player character is facing the opposite direction and I can clearly see the collider is also facing in the opposite direction, but the boss still gets hit by the laser.
Next, I get behind the boss to try and hit him and this happens:
In both directions, the boss completely ignores my attacks, I verified the colliders and I seem to understand from it that when my character is flipped to the left, the collider follows it, but it also mirrors the collider in the opposite direction and also hits the colliders to the right.
Im having a good mind freeze on this one and I can't figure it out, maybe its something really silly that I forgot, but here goes, I'll accept pretty much any idea or hypothesis about it just so we can maybe figure it out.
Thank you in advance, -Kaeros
Your answer
Follow this Question
Related Questions
Wall checking not working correctly 2 Answers
Destroy individual particle when touched 0 Answers
Draw line within bounds of circular collider 0 Answers
2D colliders not work 1 Answer
Colliding with only one object at a time 0 Answers