Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

Make sphere move for Android devices.

$
0
0
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?
Code (JavaScript):
  1. var isDead:boolean = false;
  2. var JoystickScript:Joystick;
  3. var JoystickPos:Vector3;
  4. var speed  : float;
  5. function Update () {
  6.     if (!isDead) {
  7.         //Debug.Log(JoystickScript.position);
  8.         JoystickPos = JoystickScript.position;
  9.    
  10.         if (JoystickPos.z > 0.4) {
  11.             rigidbody.AddForce(JoystickPos * speed * Time.deltaTime);...
Make sphere move for Android devices.

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>