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 BANNERTM · Mar 26, 2012 at 04:20 PM · ballrollrolling

How to roll the ball?

How to roll ball? I need rolling with correctly rotation!

Comment
Add comment · Show 6
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 Statement · Mar 26, 2012 at 04:27 PM 1
Share

Related questions.

avatar image BANNERTM · Mar 26, 2012 at 04:50 PM 0
Share

Actually I want to get metall ball. $$anonymous$$aybe I need use some physics material?

avatar image raoz · Mar 26, 2012 at 05:02 PM 0
Share

use rigidbody.AddForceAtPosition and move the force up a bit, that should help. P.S. Why cannot I add comment to my own answer

avatar image BANNERTM · Mar 26, 2012 at 05:40 PM 0
Share

I need corectly rotation - try to make rigidbody ball , just with addforceatpos or addforce, you will see that ball just slide!

avatar image raoz · Mar 26, 2012 at 05:42 PM 0
Share

It works just fine for me, try this script: using UnityEngine; using System.Collections;

 public class Force : $$anonymous$$onoBehaviour {
 
     // Use this for initialization
     void Start () {
         rigidbody.SetDensity(900);
     }
     
     // Update is called once per frame
     void Update () {
         rigidbody.AddForceAtPosition(new Vector3(10, 0, 0)/*THIS IS THE FORCE!*/, new Vector3(transform.position.x, transform.position.y + 0.2f, transform.position.z));
     }
 }
Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by raoz · Mar 26, 2012 at 04:31 PM

Use rigidbody, it is physics simulation, it has sphere, more information - http://unity3d.com/support/documentation/Components/class-Rigidbody.html

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 BANNERTM · Mar 26, 2012 at 04:45 PM 0
Share

I use rigidbody! But ball has not-correctly rotation. I use AddForce to move ball, but rotation is NOT-CORRECTLY!

avatar image AlucardJay · Mar 28, 2012 at 02:49 PM 0
Share

to push the ball around but to only have it rotate in the Y axis , you need to set the properties of the rigidbody.

In the Inspector , under the Rigidbody Component , scroll down and find the last property : Constraints

For what you want , under Freeze Rotation , Tick the X and Z checkbox. This will then stop the ball rolling forward or sideways, it will only turn to the left and right.

You need to leave the Y Unticked if you want to turn the gameObject to face a direction.

The link provided by @raoz has all this information : scroll down to Constraints.

http://unity3d.com/support/documentation/Components/class-Rigidbody.html

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

6 People are following this question.

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

Related Questions

Ball Z-Axis Rolling 1 Answer

Create a "free" rolling ball controlled by player 1 Answer

How to make a ball that can roll? 2 Answers

iPhone ball roll problem 2 Answers

How to roll a ball with moving platform. 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