I changed my code from early and I made it simple. However, I cannot get my sphere to move when I press the joystick. Any suggestions?
Make sphere move for Android devices.
Code (JavaScript):
- var isDead:boolean = false;
- var JoystickScript:Joystick;
- var JoystickPos:Vector3;
- var speed : float;
- function Update () {
- if (!isDead) {
- //Debug.Log(JoystickScript.position);
- JoystickPos = JoystickScript.position;
- if (JoystickPos.z > 0.4) {
- rigidbody.AddForce(JoystickPos * speed * Time.deltaTime);...