x


Sphere moves randomly after adding rigidbody!

Hi, I am particularly new to unity. I am currently trying to make a sphere roll down a hill slope by adding a rigidbody to it. But somehow after giving it some mass and checking the use gravity option, the sphere moves randomly during the game. Instead of falling down on the surface due to gravity it floats about randomly in the airspace. I have checked the gravity direction and it shouldn't be the problem. Any help is highly appreciated.

Thanks, Shantanu

more ▼

asked Dec 21 '11 at 06:20 AM

shantanu1singh gravatar image

shantanu1singh
16 1 2 2

This hill I'm referring to is on a "Terrain". Is there a need to add a rigidbody to Terrain too ?

Dec 20 '11 at 10:49 AM shantanu1singh

No, you definitely don't want to add a rigidbody component to your terrain.

Are you applying some force to the sphere, or just let it freely fall?

Try resetting the component and see what happens. Perhaps you fed in a problematic value.

Dec 21 '11 at 09:39 AM asafsitner

Thanks for your reply.

I am letting the sphere fall freely, no force at all. Tried resetting the rigidbody component of the sphere. No help. The sphere falls under the effect of gravity from a new position altogether. This position is random too.

As I had mentioned before on removing the rigidbody component, I find the sphere at the very same location I had positioned it. But I can't figure out what the problem with the component is.

Dec 21 '11 at 10:29 AM shantanu1singh

Are there any scripts attached to the sphere?

Dec 21 '11 at 12:33 PM asafsitner

@shantanu1singh I'm no physics expert but I was reading the Unity docs in this area the other day and in there it states that there is an implicit assumption that 1 metre = 1 unit and that scaling will affect rigid bodies and their behaviour.

I would suggest you create a sphere in your 3D package of choice that is the size you want and bring this in such that its transform has a scale of 1,1,1 and then you should have the sphere behave correctly with respect to physics and gravity.

If you make a sphere 20 units across however you will be seeing physics applied to a sphere that is 20 meters in diameter and how that (at whatever mass it has) reacts to gravity which I think defaults to 9.81m/s (negative Y).

Dec 23 '11 at 12:39 PM Bovine
(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1783
x459
x197
x59

asked: Dec 21 '11 at 06:20 AM

Seen: 800 times

Last Updated: Dec 26 '11 at 06:22 PM