i will help u but please vote me i help so many people but they do not appreciate
thanx .attach this to the gameobject u wanna flip change the buttons a or d how u want.
using UnityEngine; using System.Collections;
public class flip : MonoBehaviour {
private float X;
private Vector3 position;
// Use this for initialization
void Start () {
X=transform.localScale.x;
position=transform.localScale;
}
// Update is called once per frame
void Update () {
if(Input.GetKey("a"))
{
position.x=X;
//flip the texture
transform.localScale = position;
}
else if(Input.GetKey("d"))
{
position.x=-X;
//flip the texture
transform.localScale = position;
}
}
}
↧