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 /
This question was closed May 28, 2014 at 10:58 PM by meat5000 for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by PahlYsera · May 28, 2014 at 08:53 PM · tutorialroll a ball

Can't get roll a ball to roll

After taking a decade or so off from programming I am trying to restart using Unity... new to it and C# (used C a lot). When I hit play the ball does not move at all. I think I followed everything in the tutorial exactly, and have read all the questions like mine where the answer ends up being a typo. I am not seeing my mistake, here is the code:

using UnityEngine; using System.Collections;

public class PlayerController : MonoBehaviour { public float speed;

 void FixedUdate()
 {
     float moveHorizontal = Input.GetAxis ("Horizontal");
     float moveVeritcal = Input.GetAxis ("Vertical");

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

     Debug.Log ("moved " + moveHorizontal + " " + moveVeritcal);

     rigidbody.AddForce(movement * speed * Time.deltaTime);
 }

}

FWIW I am REALLY impressed something like this is available for free!!!

Comment
Add comment · Show 1
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 rutter · May 28, 2014 at 09:49 PM 0
Share

Is that debug log printing? Check your console window. It could be showing inappropriate values (in which case something about your input is wrong), you could see another error (in which case, fix that), or you could see nothing at all (in which case, maybe make sure the script is attached to something in the scene).

What is the value of speed? If you multiply force by zero, you won't push anything.

1 Reply

  • Sort: 
avatar image
2
Best Answer

Answer by tw1st3d · May 28, 2014 at 09:50 PM

 void FixedUdate()

should be

 void FixedUpdate()
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 PahlYsera · May 28, 2014 at 10:49 PM 1
Share

Yep, it was the misspelling of FixUpdate :)figured it would be something like that. Thanks much for the quick answer. To answer the log printing question, it was not showing anything (and it's not showing anything was the final straw before I went online to ask). The log output works (naturally) now that the function name is correct. I guess there is no equivalent of linker/loader errors in this environment....

Thanks much for the quick help!

avatar image tw1st3d · May 28, 2014 at 10:59 PM 0
Share

Glad I could help!

Follow this Question

Answers Answers and Comments

22 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

Related Questions

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

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


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