- Home /
2DBoxCollider not acting normally after rotated along y
Well, i have a script that controls my character, the script is attached to the character's graphics and the BoxCollder2D is too along with the rigidbody... So my character has to be flipped left when holding "A" button, so i used: "transform.eulerAngles = new Vector3(0, 180, 1.525879e-05f);" script to do so, and when i hold "D" button, i use: "transform.eulerAngles = new Vector3(0, 0, 0);" again... Works perfectly for the graphics, for the sprite itself, but the BoxCollier2D does not like it at all, it acts wierd, it doesen't want to be rotated along y... BTW: MAKING BLANK object and adding the box collider and rigidbody to it, and adding graphics object as it's child IS NOT MY SOLUTION... The script is huge and it's connected A LOT to it's sprite object, it can't act normally with other object...
ANYONE knows the answer ? Please help me i'm so freaking frustrated with this, i can't remake my code to work with a blank object now, it's too hard and annoying !
(Sorry for the letter missings in some words, my keyboard fu**ed up a bit)
Answer by Bentley · Sep 28, 2014 at 07:11 AM
Try:
transform.Rotate(0f, 180f, 0f);
This should accomplish the same thing with less bugginess.
Hope this helps, Bentley
Nope man, it makes the same problem and adds the even worse glitch.
$$anonymous$$y game is 2D, i hope you realized by reading "BoxCollider2D"
Your answer
![](https://koobas.hobune.stream/wayback/20220613163924im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Prefab Character position/rotation resets 0 Answers
Rotating Box Collider 2D independent of its gameObject [v4.7.2f1] 1 Answer
Skateboarding Rotation Problem 1 Answer
Script Problem 1 Answer
Rotation in animation problem 0 Answers