Question by
Mozolevskiy · Oct 28, 2015 at 08:19 PM ·
androidbuttontouchtouchscreen
How do I transfer the control to the PC on your android? how to change the script the character animation that would work? what should be done?
How do I transfer the control to the PC on your android? how to change the script the character animation that would work? what should be done?
using UnityEngine; using System.Collections;
public class CharacterController1 : MonoBehaviour {
public float maxSpeed = 10f;
bool facingRight = true;
Animator anim;
// Use this for initialization
void Start () {
anim = GetComponent<Animator> ();
}
// Update is called once per frame
void FixedUpdate () {
float move = Input.GetAxis ("Horizontal");
anim.SetFloat ("Speed", Mathf.Abs (move));
GetComponent<Rigidbody2D>().velocity = new Vector2 (move * maxSpeed, GetComponent<Rigidbody2D>().velocity.y);
if (move > 0 && !facingRight)
Flip ();
else if (move < 0 && facingRight)
Flip ();
}
void Flip() {
facingRight = !facingRight;
Vector3 theScale = transform.localScale;
theScale.x *= -1;
transform.localScale = theScale;
}
}
Comment
Answer by Kolpoiu · Dec 09, 2015 at 08:15 AM
To transfer data between android and computer effectively, tet a reliable android file transfer tool to do the job, Android Mobile Manager is a good choice, I have used this tool before and it did work on my galaxy phone
Your answer
Follow this Question
Related Questions
Touch on 2D gameobject: should i use a GUI button? 1 Answer
buttons vs touch. 1 Answer
Pausing Play on Android 0 Answers