B
B
bad22vk2020-10-10 09:25:45
Unity
bad22vk, 2020-10-10 09:25:45

Problem with Unity 2D camera?

MEN!
RESCUE!!!
I'm doing my project in Unity 2D
Everything is fine, but for several hours I can't fix some BUG !!!
When the character rotates 180 degrees, the camera rotates with him!
Which as a result gives a complete f*ck in the final version.
The screenshots show that in 3d viewing the camera flies 180 degrees, as it were.
On the forums, I found info that you can turn the camera at the same time as the character is rotated, indicating 0 degrees instead of 180 degrees. But I don't understand how to do it!!!
Thanks somebody, my head is about to explode.
1 screen before turn
2 after turn5f8153dcb8840433783105.jpeg
5f8153e5e7987966813843.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DanielMcRon, 2020-10-10
@bad22vk

One simple option is to take the SpriteRenderer component from the player and change the flip property to true or false. Instead of scale flip.
P.S, a script is being made for the camera to follow the player, and then you do not need to bind it as a child. And due to the fact that the camera is a child of the player, with scale.x = - 1, it changes its data. And put more order in the code, there are extra lines of code - which do nothing

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question