Greetings,
for the software we're developing we're finding ourselves in a situation where we need to constrain the effect of a rope, attached to a rigidbody, on another rigidbody. I made a simple diagram to illustrate the situation better (I'm not an english native speaker)
The grey sphere is where the rope attaches, and both the sphere and the red cube have rigidbody components. We want them to act in a way that, while the sphere is fully constrained in its rotations (in other words its rigidbody is frozen on all axes), the red cube is still capable of rotation on, at least, the Y axis.
We tried using constraints, but it seems that regardless of the setup the cube's rotation is frozen on all axes, much like the sphere.
Any idea on if, or how, such a rigidbody relationship can be implemented, either with proper set up constraints or by code?
I also attached the current relevant components of the cube (diverSettings) and of the rope attachment point (attachSettings)
08-07-2022, 02:40 PM (This post was last modified: 08-07-2022, 02:45 PM by josemendez.)
(08-07-2022, 02:19 PM)fconsonnibk Wrote: Greetings,
for the software we're developing we're finding ourselves in a situation where we need to constrain the effect of a rope, attached to a rigidbody, on another rigidbody. I made a simple diagram to illustrate the situation better (I'm not an english native speaker)
The grey sphere is where the rope attaches, and both the sphere and the red cube have rigidbody components. We want them to act in a way that, while the sphere is fully constrained in its rotations (in other words its rigidbody is frozen on all axes), the red cube is still capable of rotation on, at least, the Y axis.
We tried using constraints, but it seems that regardless of the setup the cube's rotation is frozen on all axes, much like the sphere.
Any idea on if, or how, such a rigidbody relationship can be implemented, either with proper set up constraints or by code?
I also attached the current relevant components of the cube (diverSettings) and of the rope attachment point (attachSettings)
Regards
Hi!
This seems to be more of a question regarding rigidbodies/joints than Obi, but will try to help nonetheless.
You don't mention what the relationship between the cube and the sphere is. Are they independent rigidbodies? are they related via joints, or are they free to move and maybe collide with each other?
The cube's mass is 100 kg. This means it will be very hard to move unless the sphere (which I assume is colliding against it) has a similar weight, but its weight is 1. So chances are the sphere will be basically unable to move the cube. If you want the sphere to be able to move the cube, both need to have comparable masses. The higher the mass of the cube, the harder it will be for a light object to affect it in any way.
Good day,
We played around with joints but we can't seem to come up with a proper solution.
Quote:You don't mention what the relationship between the cube and the sphere is. Are they independent rigidbodies? are they related via joints, or are they free to move and maybe collide with each other?
As it stands now yes, they are independent rigidbodies, linked together by joints (we need to figure out the settings of those), and they move as one unit.
Quote:The cube's mass is 100 kg. This means it will be very hard to move unless the sphere (which I assume is colliding against it) has a similar weight, but its weight is 1. So chances are the sphere will be basically unable to move the cube.
The rigidbody isn't using gravity, so it's being pushed around by basically everything, rope included.
And there's pretty much where the issue is. We need to have the rope push around the cube rigidbody but only with translation and without any rotation, and we were wondering if there's such an option with Obi ropes.
To try and be more clear I compiled a tech example of what the current situation is. As it stands extending the rope also rotates the cube, but we want to have it only pushed in the three directions.
I can't seem to be able to upload .7z files, so I uploaded the zipped file on Mega, and it's available here. Inside the zip you will also find screenshots of the settings of the cube and the rope attach points as they are in the prototype.
11-07-2022, 10:40 AM (This post was last modified: 11-07-2022, 10:41 AM by josemendez.)
(11-07-2022, 10:10 AM)fconsonnibk Wrote: And there's pretty much where the issue is. We need to have the rope push around the cube rigidbody but only with translation and without any rotation, and we were wondering if there's such an option with Obi ropes.
All Obi does is apply impulses to rigidbodies, it does not simulate them. Rigidbody simulation itself is performed by Unity, so there's no rigidbody controls in Obi at all: there isn't any option in Obi ropes that would remove rotational degrees of freedom from a rigidbody, that's up to Unity.
By freezing the cube's rotation, it should only translate. Enable all "freeze rotation" checkboxes in the cube's rigidbody component, under its "constraints" foldout. See: https://docs.unity3d.com/Manual/class-Rigidbody.html