Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
2
Question by RonW · Apr 02, 2015 at 05:55 PM · tutorialroll a ball

Roll-A-Ball Tutorial: Ball moves on its own

Hi,

I have completed the Roll-A-Ball tutorial successfully.

There's only one issue I'm having: When running the game, even if I don't do anything, after about 10 seconds the ball starts rolling forward slowly on its own.

This is highly undesirable. Because there is some force acting on the ball that I did not intend. It does not affect this simple game too much, but it could be a bigger issue in bigger projects.

I'm using Unity 5, and the tutorial was made in a 4.x version I think. So, maybe this has something to do with it.

Can anyone tell me what is causing this?

The zip file for my project can be found here: http://forum.unity3d.com/threads/roll-a-ball-tutorial-ball-moves-on-its-own.312714/ in the forums where I originally asked this question.

Comment
Add comment · Show 7
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 ozturkcompany · Apr 02, 2015 at 06:06 PM 0
Share

Im on mobile for now so cannot check the zip file atm BUT the very simple solution is adding a drag value to the ball while no input is detected.

avatar image dr3th · Apr 02, 2015 at 06:32 PM 0
Share

If you are on an incline, as in your whole plane is inclined this will happen, check that the surface is right angle(perpendicular) to the force of gravity?

avatar image Sevinn · Apr 03, 2015 at 04:54 PM 0
Share

Im having the same issue. It feels like Unity isnt recognizing that im pressing the arrow keys to move the ball. I press my arrow keys and nothing happens. Then after a few seconds it starts rolling on its own, slowly in one direction.

avatar image Sevinn · Apr 03, 2015 at 06:04 PM 0
Share

I have this exact same problem when I press left or right or the alt key a or d nothing happend then after a few seconds the ball slowly starts rolling in one direction on its own. my code is a little different than yours though:

using UnityEngine; using System.Collections;

public class PlayerController : $$anonymous$$onoBehaviour { public float speed;

 void FixedUpdate ()
 {
     float moveHorizontal = Input.GetAxis ("Horizontal");
     float moveVetical = Input.GetAxis ("Vertical");

     Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVetical);

     GetComponent<Rigidbody>().AddForce (movement * speed * Time.deltaTime);
 }

}

avatar image RonW · Apr 08, 2015 at 02:57 AM 0
Share

@ozturkcompany, that may fix it, but it would be a hack. I want to identify the root cause of the problem.

Show more comments

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by turacept · Apr 03, 2015 at 08:02 PM

The rigidbody is probably doing something funky. are you sure the controller has all of the axis's written in correctly? I used to have that problem alot. I would make a controller and then I would forget the names of my axis's so I did like horizontal "instead" of "Horizontal"

Comment
Add comment · Show 1 · 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
avatar image RonW · Apr 08, 2015 at 04:10 AM 0
Share

thanks for your input. I suspect that the ball wouldn't move at all in the relevant direction if Horizontal or Vertical were misspelled. The ball responds correctly to input, it just moves on its on slowly forward even without input.

avatar image
0

Answer by dethtoll · Apr 08, 2015 at 05:31 AM

This sounds very similar to this issue I found. There is a mystery force when using mesh colliders in Unity 5 (bug was not present in Unity 4.x)

One way I found to resolve this is to use box colliders instead of mesh colliders. In other words, the floor would sit 'on top' of a large, flat box collider.

Comment
Add comment · Show 1 · 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
avatar image RonW · Apr 08, 2015 at 06:45 AM 0
Share

Hi @dethtoll. I read your report of the issue and it sounds quite similar to the one I am experiencing. This may indeed be the problem. I hope it will soon get fixed. Thanks!

avatar image
0

Answer by Axel429 · Dec 23, 2016 at 04:30 PM

Just keep the name of the horizontal and Vertical axes for the joystick and keyboard different it will work. If both the pairs are with same name then unity sends false coordinates thinking the joystick keys are being pressed and hence the ball moves own its own.

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

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

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

Related Questions

Roll a Ball Tutorial problem 1 Answer

Error when I try to run the build in tutorial (roll a ball, tanks, and etc.) 0 Answers

Roll a Ball Tutorial does not work. Help? 3 Answers

Roll-a-ball tutorial weird shadows 0 Answers

Roll-a-ball tutorial does not work. 1 Answer


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