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
0
Question by Blazar_Jones · Sep 10, 2014 at 08:47 PM · tutorialsphere

Why won't my ball move in Roll - a - Ball?

In the roll - a- ball project, my ball was rolling fine then mono develop crashed. I could remember where I was in the tutorial. I re-did everything and the ball doesn't move. I've done everything I could, but to no avail. what can I do?

using UnityEngine; using System.Collections;

public class PlayerController : MonoBehaviour { public float speed; public GUIText countText; public GUIText winText; private int count;

 void start()
 {
     count = 0;
     SetCountText ();
     winText.text = "";
 }
 
 void FixedUpdate()
 {
     float moveHorizontal = Input.GetAxis("Horizontal");
     float moveVertical = Input.GetAxis("Vertical");
     
     
     Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
     
     rigidbody.AddForce(movement * speed * Time.deltaTime);
     
 }
 // Destroy everything that enters the trigger
 
 void OnTriggerEnter(Collider other) 
 { 
     if(other.gameObject.tag == "PickUp")
     {
         other.gameObject.SetActive(false);
         count = count + 1;
         SetCountText ();
     }
 }
 void SetCountText()
 {
     countText.text = "Count: " + count.ToString();
     if(count >= 12)
     {
         winText.text = "YOU WIN!";
     }
 }

}

here is what it looks like in unity. extreme rookie to this. please help.

alt text

unity.jpg (155.2 kB)
unity.jpg (155.2 kB)
Comment
Add comment
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

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Fanttum · Sep 10, 2014 at 11:25 PM

Is Kinematic is checked in the inspector. You want this to be false so the physics work out correctly. When Is Kinematic is checked it won't take in any forces, Read more about it here.

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 Jwizard93 · Jul 11, 2017 at 02:13 AM 0
Share

This is the correct answer. Or at least something that must be done. Have you tried it?

avatar image
0

Answer by seaoatsgaming · Jul 11, 2017 at 02:06 AM

Monodevelop may try to "convert endings" to Windows when you type up your code. You have to select "Keep file endings"

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 Jwizard93 · Jul 11, 2017 at 02:13 AM 0
Share

Really? At most I get a warning from time to time about that.

avatar image
0

Answer by TacoMakerMan · Jul 11, 2017 at 04:01 AM

You haven't added a reference to 'rigidbody' yet. Try adding

 RigidBody rigidbody;

At the beginning, and then in start, add

 rigidbody = GetComponent<RigidBody> ();
Comment
Add comment · Show 2 · 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 Jwizard93 · Jul 11, 2017 at 04:04 AM 0
Share

Yes, this as well. But still don't neglect that is$$anonymous$$inematic cannot be true for the ball.

avatar image TacoMakerMan Jwizard93 · Jul 11, 2017 at 05:43 AM 0
Share

I know, just no-one had mentioned this, and the answer talking about if is$$anonymous$$inematic had been checked for the ball had not been marked as the answer.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Raycast chase player, avoid walls.. raycast detailed C# tutorial? 0 Answers

Making a Tutorial in th emiddle of screen and more efficiant 1 Answer

Easy simple way to create a networking between 2 computers using bluetooth 2 Answers

SimpleMove details (3D platform tutorial problems) 0 Answers

Funky Glowing Things 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