- Home /
Weird flipping gameobject
I've got problem with flipping an enemy prefab. This piece of code is resposible for a flip:
void Flip() {
Vector2 e = myTransform.localScale;
e.x *= -1;
myTransform.localScale = e;
}
This is how it looks:
Why is that happening to the prefab?
Someone fixed this recently.
I'm trying to find it, but can't
I'm letting you know the answer is out there and its pretty recent.
Do you remember any tags or keywords? And by pretty recent you mean month ago or day ago?
Answer by grzesiu10 · Feb 28, 2015 at 12:35 AM
I figured it out. The reason was that I used Vector2 instead of Vector3. Anyway, thank you for help! :)
Your answer
Follow this Question
Related Questions
When fliping the character the rotation of character's weapon goes backward 0 Answers
GameObject not working with variable in C# script 3 Answers
Adding a prefab to gameObject at a certain position in runtime 0 Answers
Creating new Transform from existing objects Transform to Instantiate object 1 Answer