- Home /
This question was
closed Sep 25, 2017 at 08:42 PM by
hexagonius for the following reason:
Duplicate of your own answered question
Question by
DiamondMC102 · Sep 24, 2017 at 11:53 PM ·
c#scripting problem2d game2d-platformerflip
Don't Flip Child, Only Parent.
How can I flip only the parent, and not the child. Please give me an example c# script on how to do this and explain.
Here's my code;
private void Flip(float horizontal)
{
if (horizontal > 0 && !facingRight || horizontal < 0 && facingRight)
{
facingRight = !facingRight;
Vector3 thescale = indingoGraphics.localScale;
thescale.x *= -1;
indingoGraphics.localScale = thescale;
}
}
Comment
Follow this Question
Related Questions
How can I flip only my 'Player' gameobject, and l leave it's child object alone? 2 Answers
Flip Player, but don't flip the Player's Child. 2 Answers
Add audio. 1 Answer
How to Find gameObject child. 3 Answers
What happened to Line Renderer! 1 Answer