- Home /
Question by
MaG3Stican · Jan 27, 2015 at 02:21 AM ·
rotationflippoint lightpointlight
When 2dsprite is flipped (rotation.y = 180) the 2d light does not work
Well I am having this problem were if I flip my object ( set rotation to y = 180), the point light I have over the object does not work.
with rotation = 0 :
with rotation = 180
Any ideas how to solve this?
capture.png
(224.7 kB)
capture.png
(169.8 kB)
Comment
Answer by yashpal · Jan 29, 2015 at 07:05 AM
hello @MaG3Stican , you can solve this problem. If you rotate your sprite by 180 than unity not render light so use scale -1 to flip your character. so light effect your character.
so you can use this to flip
transform.localScale = new Vector3 (-transform.localScale.x, transform.localScale.y, transform.localScale.z);
Here I found link which can help you.
Your answer
Follow this Question
Related Questions
Flip over an object (smooth transition) 3 Answers
Camera Rotation stay behind player and not flip 2 Answers
Sprite disapears when moving left 2 Answers
2D character flipping issue 3 Answers