- Home /
Flip Player, Not the Player's Child.
Okay, I have a Player game component and the Player has a Child game component. How can I flip only the Player, and not the Child? Please give me an example in 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;
}
}
If any of the users I called made it here I called you, because you guys are the best I know at this(not trying to kiss any butt).
And if you are not the users I called please still answer if your know how to help
You appear to have asked this question several times now. What was wrong with the other answers people gave you?
Answer by tomhughes · Sep 25, 2017 at 11:09 AM
umm, i have an idea. worth a shot as it might be an easy fix:
In the hierarchy why not have the player separate from the child but under one main empty game object?
so instead of
player: /child
it is
-player controller: /player /child
Answer by Timo326 · Sep 25, 2017 at 12:26 PM
You postet this question several times. I gave you an answer with code example on one of your other posts. Did you check it?
Answer by DiamondMC102 · Sep 25, 2017 at 03:13 PM
@Timo326 hausmann I just learned how to switch back to my previous questions, because i'm still kind of new to unity. So I decided to make a new question because I couldn't find it. But I'm going to go back to the previous question and work on what you sent me, and work on it in a few hours because I'm literally in my highschool right.
Your answer
Follow this Question
Related Questions
How can I flip only my 'Player' gameobject, and l leave it's child object alone? 2 Answers
Add audio. 1 Answer
Don't Flip Child, Only Parent. 0 Answers
How to Find gameObject child. 3 Answers
What happened to Line Renderer! 1 Answer