- Home /
Question by
Zenerzlight · Nov 18, 2019 at 08:37 PM ·
patrol
hello, im trying to flip my 2d patrolling character (Horizontal patrol) every time i tap my screen or mouseclick
Is there a way to flip my 2-D patrolling character every time i mouse click or tap screen. Basically i want it to change direction every time i tap my screen.
Comment
Answer by Naggil · Nov 19, 2019 at 09:55 PM
its simple
void Update(){
if (Input.GetMouseButtonDown(0))
{
transform.localScale = new Vector3(-transform.localScale.x, transform.localScale.y, transform.localScale.z);
}
}
Your answer
Follow this Question
Related Questions
hazard Ai patroling with navMesh. 0 Answers
Unity Navmesh agent patrol and chase player script issues. 0 Answers
Make AI move using CharacterController.Move instead of rigidbody.velocity? 3 Answers
How do I get the AI to patrol back to his points once I am not in his vision anymore? 0 Answers
Shooting Enemy AI with Patrol 2 Answers