- Home /
Canvas is flipping, 2D game
Hello guys. So I have a CharacterMovement script, where instead of making animations for left and right seperately i use void flip()
bool facingRight = true;
public void Flip()
{
facingRight = !facingRight;
Vector3 theScale = transform.localScale;
theScale.x *= -1;
transform.localScale = theScale;
}
so it just flips the localScale to -1, and the player has turned left ^^
I want to attach a canvas or text (UI), that holds the name of the player. But everytime the player flips, the canvas also flips. I don't want the name of the player(the canvas holds it) to flip too. I want the name to remain still. I tried a lot of things, i found a similar answer here in unity answers. I don't seem to understand what's going on, or what I'm supposed to do. A guy wrote that I must make a seperate object a controller(tried that, my game went crazy, no animations, infinite jumping etc.)
Any help is greatly appriciated!
Your answer
Follow this Question
Related Questions
Canvas UI Priority layers 1 Answer
Quick Question on UI Text Alignment 1 Answer
How to display UI Text on GameObject in script? 0 Answers
How to add total quantity of a score after the changing score Int? 1 Answer
UI fade with CanvasGroup vs of Image.color.alpha or Text.color.alpha performance 1 Answer