x


Same reaction with different number of objects colliding

Hi!

I have an object (a ball) with a rigidbody because I need that this ball is affected by gravity. After I have different surfaces where the ball can run. The problem I have is that I add a force to up (Y-axis) when a key is pressed but the reaction is not the same if the ball is only colliding with 1 object (for example in a flat surface) that when is colliding with 2 objects (for example when the ball is between 2 tubes). In the 2nd case, the ball ups with less force than in the 1st case.

I would like to obtain the same reaction in both cases. It is that possible?

Thanks a lot!

more ▼

asked Aug 21 '10 at 06:15 AM

SeRoX gravatar image

SeRoX
57 6 6 12

I've noticed similar behaviors when simulating a car (rigidbody with one box collider + 4 wheel colliders). I can read the forces applied on each wheel collider (WheelHit.force), and when the car touches other colliders, the forces suddenly decrease. Strange.

Aug 21 '10 at 10:47 AM Edy
(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

Instead of add force you can alter the rigidbody velocity directly. You can also try reducing friction at the moment you press jump so there's less sticking caused by other objects.

more ▼

answered Aug 21 '10 at 01:16 PM

spinaljack gravatar image

spinaljack
9.1k 18 31 91

Yes! Altering velocity instead of force works. Thanks!

Aug 21 '10 at 05:48 PM SeRoX

ahh, the friction was the key! sure, two objects cause double friction... I'll experiment with that.

Aug 22 '10 at 11:34 AM Edy
(comments are locked)
10|3000 characters needed characters left

Thank you, this helped me aswell :D

more ▼

answered Mar 21 '11 at 01:09 PM

Orion 3 gravatar image

Orion 3
3 1 1 2

(comments are locked)
10|3000 characters needed characters left
Your answer
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:

x5059
x1865
x1783
x1683

asked: Aug 21 '10 at 06:15 AM

Seen: 1192 times

Last Updated: Aug 21 '10 at 06:15 AM