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 aabrams1654 · Jan 19, 2015 at 07:48 AM · beginner

Roll a ball tutorial Problem Please Help

Roll A Ball Moving the Player. It doesnt work. I have no error codes, no warnings, nothing shows up as wrong and yet I hit play and nothing I mean nothing happens. I am an animator working with 4 programmers who cannot be bothered. 20 hours wasted on this and I do not know what on earth is wrong. Sending my script as an attachment so someone who actually knows C# and isn't guessing like me can tell me its messed up or where I messed up. Yes the script is on the ball/Player.

link text

or

 using UnityEngine; using System.Collections;
 
 public class godsavethePlayer : MonoBehaviour 
 {
     void FixedUpdate ()
     { 
         float moveHorizontal = Input.GetAxis ("Horizontal"); 
         float moveVertical = Input.GetAxis ("Vertical");
         
         Vector3 movement = new Vector3 (moveHorizontal,0.0f,moveVertical);
         
         rigidbody.AddForce (movement * Time.deltaTime);
     }    
 } 



Had to add extra spaces to get it to show up as more than 4 lines

rolllaball.txt (375 B)
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 meat5000 ♦ · Jan 19, 2015 at 10:03 AM 0
Share

Indeed. 4 programmers and you are all working on a tutorial?

Describe what does happen, and what doesn't happen.

avatar image aabrams1654 · Jan 19, 2015 at 04:17 PM 0
Share

Thank you all for your help. I like learning but this is completely out of my realm. I dont know the rules so how would I know what commands work with things like gravity vs kinematic. I dont code. I dont do physics. Animator my job is to break the rules of reality lol. Wheres a good place for someone who is level 0 in skill to learn this stuff. Right now this isnt learning its monkey see monkey do and god forbid I click something on accident.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by gjf · Jan 19, 2015 at 09:13 AM

2 pieces of advice:

1) Add a Debug.Log in FixedUpdate to check that it's getting there

2) dump those programmers - if they can't be bothered, find some that can.

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
avatar image
0

Answer by Baste · Jan 19, 2015 at 09:41 AM

So, there's some possible reasons I can think of:

1: you might not have set up the input axes in the Input Manager. Horizontal and Vertical might be mapped to some other keys than what you're expecting.

2: The rigidbody you're trying to do this with is kinematic. In that case, it doesn't react to force.

3: You're doing this is FixedUpdate, while the Input function resets every Update frame. The axes should still have values in Fixed, but there might be issues.

if you add Debug.Log(movement) in before the AddForce, you'll see if you're getting any readings at all, which will narrow it down.

Oh, and before anyone goes "you should use Time.fixedDeltaTime instead!", Time.deltaTime is Time.fixedDeltaTime in FixedUpdate, so don't even bother.

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 aabrams1654 · Jan 19, 2015 at 04:04 PM 0
Share

Yes it was set to kinematic and gravity. The ball moves now, all though I must say extremely slow. All the informatin listed by everyone is good to know thank you very much.

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

Unity jumping sound, help. 1 Answer

How to upload a game to the internet 1 Answer

How do you CORRECTLY call methods from another C# file 1 Answer

how do I save a script when access is denied? 0 Answers

Unity 5 can't start up 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