Hey, Ive been messing around in Unity these past few days with a sphere trying to get a few things right but I have absoloutly no idea =/.
My first question is I have a sphere that moves around but I can't make it look as though its "rolling" how do I do this?
My second question is can I make my ball bounce along other objects, and make it controllable whilst bouncing?
And my third is I have a flat plane made from a cube and a curved plane next to it, when I move onto the curved I can't go agaisnt the force and move up the cube my sphere only falls down, I've tryed messing with gravity but that doesn't change anything.
Answer by Jason B
Jan 03, 2011 at 03:18 AM
If your intent is to make the ball physics-enabled only, it's easy to make your ball roll by applying some higher friction to the physics material that is attached to the rigidbody (I believe dynamic friction will help you most with it, but try increasing both static and dynamic; if either one is too low, you'll get a ball that keeps wanting to slide, and unless your ball is made of ice, it typically doesn't happen).
Friction is the answer to the second part of your problem as well. Increase the friction of the physics material and you should have less of a problem climbing that hill.
Once you increase the friction though so that the ball is behaving realistically, you may want to start using applyTorque to spin the ball instead of applyForce to push the ball around. This will drastically enhance how realistically it rolls about, because as you probably know, this is similar to how a wheel on a car operates. It doesn't mobilize by being pushed by an external force, it mobilizes by spinning.
Hope this helps. I made a physics-based ball rolling 3D platformer in Unity so I know a lot about this subject. :)
Answer by Justin Warner
Jan 02, 2011 at 09:32 PM
You must animate the ball... If W is pressed, do this animation. Animate in 3D Modeling software. http://unity3d.com/support/documentation/ScriptReference/Animation.html
To make it bounce, have you tried adding rigid body, and changing the physics of the material around it? I don't know the exact answer to be honest...
Are you using a controller script that came with Unity? If so, their is something with the word slope in it, change that around...
Also, for future references, you should separate all questions in their own... This keeps it neat, and you get more answers (For example, I don't know the answer to 2... But someone else might, but they don't want to just answer one question, if that makes sense =) ).
Have a good one and good luck!
Cheers and Thanks alot =D
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a user guide.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
Answers and Comments
No one has followed this question yet.
How to make a ball roll by pushing it with a cube?
Bouncy Ball Game
I am having a problem trying to simulate football(soccer) physics
How to make a ball that can roll?
Ball Rolling System