Posts: 18
Threads: 1
Joined: Oct 2021
Reputation:
0
(20-10-2021, 09:53 AM)josemendez Wrote: Don't really understand this question... ropes already have a limited length, their rest length. They won't exceed this length (that is, unless you attach their ends to transforms using static attachments, in that case you would be forcing them to stretch).
Still don't understand....why not using the order in which they appear in the hierarchy? the "solver.actors" array in the solver contains *exactly* the same data as Unity's transform hierarchy, but in a random order as it's basically a set: order does not matter. Unity will give them to you ordered, which is what you need right? why access them trough the actors array?
As I mentioned before, transform.GetChild() will give them to you in the order they appear in the scene hierarchy. So if you only have ropes inside the solver, you can access them ordered like this:
Code: var rope1 = solver.transform.GetChild(0).GetComponent<ObiRope>(); // first rope
var rope2 = solver.transform.GetChild(1).GetComponent<ObiRope>(); // second rope
var rope3 = solver.transform.GetChild(2).GetComponent<ObiRope>(); // third rope
If you have other objects mixed in, simply check whether or not they have a rope component. Thank you, I solved the issue with the order of the ropes. I would like to know if it is possible to make the rope not stretch further after reaching its maximum length. So that I could pull it, for example, only 2 meters (conditionally) and could not go further
Posts: 6,322
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
20-10-2021, 02:30 PM
(This post was last modified: 20-10-2021, 02:32 PM by josemendez.)
(20-10-2021, 02:12 PM)Matbee Wrote: I would like to know if it is possible to make the rope not stretch further after reaching its maximum length. So that I could pull it, for example, only 2 meters (conditionally) and could not go further A rope won’t stretch beyond its rest length unless you force it to, by for instance, attaching its ends using static attachments and directly setting the position of both ends. There’s nothing the rope can do to avoid being stretched if you explicitly set the position of both its ends.
Use dynamic attachments to attach the rope to rigidbodies. This way, the rope will apply a force to keep the rigidbodies from moving once the rope is tense.
Check out the manual, it explains the difference between static and dynamic attachments:
http://obi.virtualmethodstudio.com/manua...ments.html
Also, check the Crane, ChainBall and WrapTheRope scenes for examples on how to use dynamic attachments.
Posts: 18
Threads: 1
Joined: Oct 2021
Reputation:
0
20-10-2021, 04:06 PM
(This post was last modified: 20-10-2021, 04:09 PM by Matbee.)
(20-10-2021, 02:30 PM)josemendez Wrote: A rope won’t stretch beyond its rest length unless you force it to, by for instance, attaching its ends using static attachments and directly setting the position of both ends. There’s nothing the rope can do to avoid being stretched if you explicitly set the position of both its ends.
Use dynamic attachments to attach the rope to rigidbodies. This way, the rope will apply a force to keep the rigidbodies from moving once the rope is tense.
Check out the manual, it explains the difference between static and dynamic attachments:
http://obi.virtualmethodstudio.com/manua...ments.html
Also, check the Crane, ChainBall and WrapTheRope scenes for examples on how to use dynamic attachments. I made a small BoxCollieder and Rigidbody with constraints on rotation and movement in all axes. Now when I reach the maximum length of the rope, it no longer stretches, but its end is not rigidly fixed to the anchor point and the rope can move further, how can this be fixed? I pull the other end and it doesn't stop
(20-10-2021, 02:30 PM)josemendez Wrote: A rope won’t stretch beyond its rest length unless you force it to, by for instance, attaching its ends using static attachments and directly setting the position of both ends. There’s nothing the rope can do to avoid being stretched if you explicitly set the position of both its ends.
Use dynamic attachments to attach the rope to rigidbodies. This way, the rope will apply a force to keep the rigidbodies from moving once the rope is tense.
Check out the manual, it explains the difference between static and dynamic attachments:
http://obi.virtualmethodstudio.com/manua...ments.html
Also, check the Crane, ChainBall and WrapTheRope scenes for examples on how to use dynamic attachments. I want to pull on the fork, but so that it does not move beyond some tension limit of the rope, I added a dynomial attachment to the anchorage point on the floor
Posts: 6,322
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(20-10-2021, 04:06 PM)Matbee Wrote: I made a small BoxCollieder and Rigidbody with constraints on rotation and movement in all axes. Now when I reach the maximum length of the rope, it no longer stretches, but its end is not rigidly fixed to the anchor point and the rope can move further, how can this be fixed? I pull the other end and it doesn't stop
How are you pulling the other end? Is the other end a dynamic attachment?
(20-10-2021, 04:06 PM)Matbee Wrote: I want to pull on the fork, but so that it does not move beyond some tension limit of the rope, I added a dynomial attachment to the anchorage point on the floor
This doesn't make any sense: adding a dynamic attachment to the floor will have no effect, since the floor is not a rigidbody, and the rope does not need to apply forces to the floor.
You must add the dynamic attachment to the fork, and pull from it using forces. As soon as the pulling force applied by you and the force applied by the rope cancel out, you won't be able to pull further.
Posts: 18
Threads: 1
Joined: Oct 2021
Reputation:
0
(20-10-2021, 05:41 PM)josemendez Wrote: How are you pulling the other end? Is the other end a dynamic attachment?
This doesn't make any sense: adding a dynamic attachment to the floor will have no effect, since the floor is not a rigidbody, and the rope does not need to apply forces to the floor.
You must add the dynamic attachment to the fork, and pull from it using forces. As soon as the pulling force applied by you and the force applied by the rope cancel out, you won't be able to pull further.
Good day, I have been trying for half a day to make my ropes look like the ropes shown in the second video, but nothing comes out. Please tell me what parameters should I set so that the ropes behave in a similar way. Thanks. Oh how Can I attach a video???
Posts: 6,322
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
21-10-2021, 10:26 PM
(This post was last modified: 21-10-2021, 10:27 PM by josemendez.)
(21-10-2021, 10:14 PM)Matbee Wrote: Oh how Can I attach a video???
Simply paste its url here.
Note you can’t upload videos directly to a forum as they are way too heavy for us to host them. They must be uploaded to a video platform such as youtube or vimeo.
Posts: 18
Threads: 1
Joined: Oct 2021
Reputation:
0
21-10-2021, 10:42 PM
(This post was last modified: 21-10-2021, 11:23 PM by Matbee.)
(21-10-2021, 10:26 PM)josemendez Wrote: Simply paste its url here.
Note you can’t upload videos directly to a forum as they are way too heavy for us to host them. They must be uploaded to a video platform such as youtube or vimeo. is google disk suitable?
(21-10-2021, 10:26 PM)josemendez Wrote: Simply paste its url here.
Note you can’t upload videos directly to a forum as they are way too heavy for us to host them. They must be uploaded to a video platform such as youtube or vimeo. https://drive.google.com/drive/folders/1...sp=sharing
Posts: 6,322
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(21-10-2021, 10:42 PM)Matbee Wrote: is google disk suitable?
https://drive.google.com/drive/folders/1...sp=sharing
Yes, google drive work fine. Any place that can host the video is.
The second video just shows some ropes colliding with each other. This should just work straight out of the box, there's no parameter you need to change.
-Maybe there's too many gaps in between particles, trough which ropes can pass trough each other? This can happen if your ropes are too tense or their resolution is too low. Add a ObiParticleRenderer component to them to visually debug the particles.
-Maybe particle collisions are disabled in the solver?
Posts: 18
Threads: 1
Joined: Oct 2021
Reputation:
0
22-10-2021, 07:56 AM
(This post was last modified: 22-10-2021, 08:00 AM by Matbee.)
(22-10-2021, 07:18 AM)josemendez Wrote: Yes, google drive work fine. Any place that can host the video is.
The second video just shows some ropes colliding with each other. This should just work straight out of the box, there's no parameter you need to change.
-Maybe there's too many gaps in between particles, trough which ropes can pass trough each other? This can happen if your ropes are too tense or their resolution is too low. Add a ObiParticleRenderer component to them to visually debug the particles.
-Maybe particle collisions are disabled in the solver? in the second video the ropes are very weak to bend, they are almost always straight, move slowly, practically do not spring
Here are some more examples
https://drive.google.com/drive/folders/1...sp=sharing
(22-10-2021, 07:18 AM)josemendez Wrote: Yes, google drive work fine. Any place that can host the video is.
The second video just shows some ropes colliding with each other. This should just work straight out of the box, there's no parameter you need to change.
-Maybe there's too many gaps in between particles, trough which ropes can pass trough each other? This can happen if your ropes are too tense or their resolution is too low. Add a ObiParticleRenderer component to them to visually debug the particles.
-Maybe particle collisions are disabled in the solver? https://drive.google.com/drive/folders/1...sp=sharing
here is the current setting of my rope
Posts: 6,322
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
22-10-2021, 08:04 AM
(This post was last modified: 22-10-2021, 08:14 AM by josemendez.)
(22-10-2021, 07:56 AM)Matbee Wrote: in the second video the ropes are very weak to bend
You can control bending using the rope's bend constraints:
http://obi.virtualmethodstudio.com/manua...aints.html
Increasing compliance will make ropes easier to bend.
Max bending determines the amount of bending at which ropes start to oppose bending. A value of zero means the ropes will always offer resistance to bending (how much resistance is determined by compliance). Higher values will allow the rope to easily bend for a bit, then start resisting bending.
(22-10-2021, 07:56 AM)Matbee Wrote: they are almost always straight, move slowly, practically do not spring
Increase the solver's velocity damping. This will cause particles to lose kinetic energy, make them move slowly as if surrounded by a thick atmosphere. See:
http://obi.virtualmethodstudio.com/manua...olver.html
I see you've set this value to 0.99, that should be more than enough to achieve the behavior seen in the video. If what you're getting is not similar, may you share a video of your current results?
Edit: I saw your videos, I'm assuming the "issue" videos are your current results, and the "right" video is the reference game you're trying to replicate, correct? How are you moving the cubes at the ends of your rope? Looks to me like you're directly setting their transform. This will bypass rope physics entirely, ignoring any forces applied by the rope. This will enable the user to continue pulling the rope even when it's completely tensed up, and make very violent motions that cause tunneling (ropes passing trough each other). As already mentioned before you must use forces to move the cubes at the ends of the rope, and make sure they're attached via dynamic attachments.
|