x


Minimum distance on configurable joint?

Is it possible to set a configurable joint to have a "minimum distance". For example to set the two connected objects not to be able to move within 10 units of one another. Obviously you can set a maximum distance (the linear limit) but I cannot find a minimum distance. If it doesn't exist then can anyone think of a way that I can implement it?

Thanks in advance!

more ▼

asked Jan 31 '11 at 11:53 PM

ROM gravatar image

ROM
262 46 49 58

Why rotation tag? are you trying to rotate or move the joint?

Feb 01 '11 at 07:17 AM Jean Fabre
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Hi,

If you actually move the joint anchor point say 20 unit in x, and set the linear limit to 10, then you end up with a joint that will prevent the two connected objects to be closer than 10 units, but you are then also limited on the maximum distance between the two, which will be in that case 30.

The solution ( untested ) would be to adjust the linear limit value in real time as the joint is evolving if you actually want to have unlimited or uneven maximum/minimum.

Also, could you describe why you are actually willing to do this, their might be other way around this problem. Are you trying to do technical rigs, or something like that?

One quick solution that I would test as well is to put hard limits using colliders, this might be sufficient for your problem. But be careful, the two connected bodies collider are not able to interact with each other ( very unfortunate, at least they could offer a toggle to enable it...), you'll have to build another collider parented to one of the connected body.

If you are stuck, I can provide a small example if that would help you progress.

Bye,

Jean

more ▼

answered Feb 01 '11 at 07:16 AM

Jean Fabre gravatar image

Jean Fabre
3.1k 68 75 103

I am employing physics similar to "world of goo" (connections between balls) and I need it so that once connected two balls cannot go within a certain distance of one another, if it's easier then they could permanently be a fixed distance away from eachother. Each of them moves fairly often. Unfortunately due to a gameplay mechanic I can't simply put colliders in (although that is a fantastic idea). I tried to implement your idea about a linear limit and anchor but I unfortunately could not get it working. Thanks for your help though. Much appreciated!

Feb 01 '11 at 09:21 PM ROM

Are you aware the layer collision matrix in the physics settings? this is potential the missing link for your case, create a set of colliders that only interact with each other to achieve your desired result.

Feb 02 '11 at 09:34 AM Jean Fabre
(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:

x3737
x2166
x146
x17

asked: Jan 31 '11 at 11:53 PM

Seen: 1424 times

Last Updated: Jan 31 '11 at 11:53 PM