Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
This question was closed Jan 05, 2016 at 03:23 PM by Aleg8r for the following reason:

Problem Solved with no answer needed

avatar image
0
Question by Aleg8r · Jan 04, 2016 at 07:04 PM · axisvirtualbuild and runhorizontal

Player movement In Play mode and Unity Remote but not on Android build

Please help i can move my player in unity in play mode and with the unity remote but when i build the game for my android it will not allow me to move the player but the joystick moves

the jump button works great just no movement

Player Movement Script:

 #pragma strict
 
 private var isGrounded : boolean = false;
 private var anim : Animator;
 private var rb2d : Rigidbody2D;
 public var whatIsGround : LayerMask;
 var doubleJump : boolean = false;
 public var maxSpeed : float = 6f;
 public var groundCheck : Transform;
 public var lookingRight : boolean = true;
 public var jumpForce : float = 1000f;
 public var Boost : GameObject;
 public var Cloud : GameObject;
 public var jump : AudioClip;
 public var land : AudioClip;
 
 function Start () {
     anim = GetComponent(Animator);
     rb2d = GetComponent(Rigidbody2D);
     Cloud = GameObject.Find("Cloud");
 }
 
 function OnCollisionEnter2D(collision2D: Collision2D) {
         
         if (collision2D.relativeVelocity.magnitude > 20){
             Boost = Instantiate(Resources.Load("Prefabs/Cloud"), transform.position, transform.rotation) as GameObject;
             AudioSource.PlayClipAtPoint(land, Camera.main.transform.position);
         }
     }
 
 function Update () {
 
         if (UnityStandardAssets.CrossPlatformInput.CrossPlatformInputManager.GetButtonDown ("Jump") && (isGrounded || !doubleJump)) {
             rb2d.AddForce (new Vector2 (0, jumpForce));
 
             if (!doubleJump && !isGrounded) {
                 doubleJump = true;
                 Boost = Instantiate (Resources.Load ("Prefabs/Cloud"), transform.position, transform.rotation) as GameObject;
                 AudioSource.PlayClipAtPoint (jump, Camera.main.transform.position);
             }
         }
 
         if (UnityStandardAssets.CrossPlatformInput.CrossPlatformInputManager.GetButtonDown ("Boost") && !isGrounded) {
             rb2d.AddForce (new Vector2 (0, -jumpForce));
             Boost = Instantiate (Resources.Load ("Prefabs/Cloud"), transform.position, transform.rotation) as GameObject;
             AudioSource.PlayClipAtPoint (jump, Camera.main.transform.position);
         }
     }
 
 function FixedUpdate()    {
 
         if (isGrounded) 
             doubleJump = false;
         
         var hor : float = UnityStandardAssets.CrossPlatformInput.CrossPlatformInputManager.GetAxis ("Horizontal");
 
         anim.SetFloat ("Speed", Mathf.Abs (hor));
 
         rb2d.velocity = new Vector2 (hor * maxSpeed, rb2d.velocity.y);
           
         isGrounded = Physics2D.OverlapCircle (groundCheck.position, 0.15F, whatIsGround);
 
         anim.SetBool ("IsGrounded", isGrounded);
 
         if ((hor > 0 && !lookingRight)||(hor < 0 && lookingRight))
             Flip ();
          
         anim.SetFloat ("vSpeed", GetComponent(Rigidbody2D).velocity.y);
 }
 
 public function Flip()    {
         lookingRight = !lookingRight;
         var myScale : Vector3 = transform.localScale;
         myScale.x *= -1;
         transform.localScale = myScale;
 }
 
 public function Death(){
         Destroy(gameObject);
 }

please see image of the control stick

alt text

help.jpg (138.9 kB)
Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image brunocoimbra · Jan 04, 2016 at 11:42 PM 0
Share

Using the joystick in Unity Remote works?

avatar image Aleg8r brunocoimbra · Jan 05, 2016 at 07:25 AM 0
Share

Perfectly just stops after the build I have tested on an s3 and an asus transformer tf300 the jump button works no movement at all from the player but the joystick moves onscreen

1 Reply

  • Sort: 
avatar image
0

Answer by Aleg8r · Jan 05, 2016 at 10:10 AM

I removed the Menu system i was using and it works after building.

Thanks to all who looked at this problem and tried to solve it.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

38 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

[InputManager] Bind Negative Button and Positive Button to Touch Input 0 Answers

Argument: Input Axis Horizontal is not set up. 3 Answers

How do you make the vrtk rotator accommodate more than one axis at a time? 0 Answers

Urgent !!! New to Unity and Oculus, Run samples Wrong 0 Answers

Deploying to LG V20 from Unity 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges