- Home /
how to flip a 3d character.,how can i flip my 3d character to the left?
using UnityEngine; using System.Collections;
public class PlayerController: MonoBehaviour { public float speed = 10.0f; public Animator anim;
void Update()
{
float translation = Input.GetAxis("Horizontal") * speed;
translation *= Time.deltaTime;
transform.Translate(0, 0, translation);
if (translation == 0)
{
anim.SetBool("running", false);
}
else
{
anim.SetBool("running", true);
}
}
}
Answer by Marioooo · Oct 17, 2019 at 01:22 AM
Hi! i think maybe you should post more infor and context befor posting the question...
I can deduce from your code that you are making a 3D plataformer...
you can make a rotation effect to rotate on Y axis... that way you would TURN intead of flip... the flip way is used on 2D...
yeah sorry, i'm doing a 2.5 d platform. i ahve my 3d character moving only on the x axes. and i want to flip him by 180 while going left.
Your answer
Follow this Question
Related Questions
2D Character Flip 2 Answers
2D example: Flip character without moving 0 Answers
changing the 3D character or character's body after picking up an object 0 Answers
Infinite Runner Movement 2 Answers
IK not working 1 Answer