Posts: 7
Threads: 2
Joined: Sep 2017
Reputation:
1
26-09-2017, 04:48 AM
(This post was last modified: 26-09-2017, 04:50 AM by dignifiedweb.
Edit Reason: Added more info.
)
Hi,
I love your rope asset so far! I was wondering, is there a way to get the rope snug up against the collider? I followed along with your youtube tutorial to make a rope attached to a cube, but using all defaults, my cube is a considerable distance away from the rope at runtime. When I add the Pin Constraint (pinned to object) on the bottom rope particle, it automatically adds an offset in the Y access. I noticed, if I drop that Y access down a bit, it brings it closer to the collider. In the tutorial, it also mentioned adjusting the distance in the solver itself, I did that as well, but no impact for some reason. Any ideas what I'm doing wrong?
Here's a screenshot:
Youtube tutorial I followed
I can also provide you the scene if needed, let me know. If I revert to defaults, it is the same result I have found.
I should note: I pinned the top particle to the top cube instead of pinning in place, which is what was done in the tutorial.
Posts: 6,321
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
26-09-2017, 09:33 AM
(This post was last modified: 26-09-2017, 09:37 AM by josemendez.)
(26-09-2017, 04:48 AM)dignifiedweb Wrote: Hi,
I love your rope asset so far! I was wondering, is there a way to get the rope snug up against the collider? I followed along with your youtube tutorial to make a rope attached to a cube, but using all defaults, my cube is a considerable distance away from the rope at runtime. When I add the Pin Constraint (pinned to object) on the bottom rope particle, it automatically adds an offset in the Y access. I noticed, if I drop that Y access down a bit, it brings it closer to the collider. In the tutorial, it also mentioned adjusting the distance in the solver itself, I did that as well, but no impact for some reason. Any ideas what I'm doing wrong?
Here's a screenshot:
Youtube tutorial I followed
I can also provide you the scene if needed, let me know. If I revert to defaults, it is the same result I have found.
I should note: I pinned the top particle to the top cube instead of pinning in place, which is what was done in the tutorial.
Hi!
This happens because both distance and pin constraints have an opinion on how the rope should look like, and the distance constraints' one is more prevalent.
Look at the bottom of this page:
http://obi.virtualmethodstudio.com/tutor...olver.html
There you can see that it is possible to change the relative importance of constraints, so that pin constraints are applied last and their "opinion" prevails .
In your case, you should draw pin constraints below distance constraints in the ObiSolver's constraint order list. Also increasing the amount of pin constraint iterations will help.
cheers,
Posts: 7
Threads: 2
Joined: Sep 2017
Reputation:
1
28-09-2017, 03:33 AM
(This post was last modified: 28-09-2017, 03:56 AM by dignifiedweb.)
(26-09-2017, 09:33 AM)josemendez Wrote: Hi!
This happens because both distance and pin constraints have an opinion on how the rope should look like, and the distance constraints' one is more prevalent.
Look at the bottom of this page:
http://obi.virtualmethodstudio.com/tutor...olver.html
There you can see that it is possible to change the relative importance of constraints, so that pin constraints are applied last and their "opinion" prevails .
In your case, you should draw pin constraints below distance constraints in the ObiSolver's constraint order list. Also increasing the amount of pin constraint iterations will help.
cheers,
Thank you for the quick reply! That helped a lot, but unfortunately I still can't get both the top and bottom pinned cubes to have the rope snug on both ends right up to the collider.
Although, I feel like if I play with this order, it will still help, don't have much time today to go through it more. However, it got me thinking, what's the white box that goes around the rope? Is that where the Obi collider is for the rope? The reason I ask, is because my top pin is pinned right up against the top cube. The bottom one is now pinned snug to the bottom cube right up against the white box. The white box only being visible in the inspector window of course (pictured in my screenshot above still).
I hope I'm explaining it ok.
Edit:
I was able to get it snug on both ends by using your advice, then on the bottom pin constraint I had to bring in the Y offset just a bit. Here's a screen of what I'm talking about:
It would still be nice to know about what the white box is at runtime, what is it visualizing in the editor there?
Thanks again!
Posts: 6,321
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
28-09-2017, 08:55 AM
(This post was last modified: 28-09-2017, 08:58 AM by josemendez.)
(28-09-2017, 03:33 AM)dignifiedweb Wrote: Thank you for the quick reply! That helped a lot, but unfortunately I still can't get both the top and bottom pinned cubes to have the rope snug on both ends right up to the collider.
Although, I feel like if I play with this order, it will still help, don't have much time today to go through it more. However, it got me thinking, what's the white box that goes around the rope? Is that where the Obi collider is for the rope? The reason I ask, is because my top pin is pinned right up against the top cube. The bottom one is now pinned snug to the bottom cube right up against the white box. The white box only being visible in the inspector window of course (pictured in my screenshot above still).
I hope I'm explaining it ok.
Edit:
I was able to get it snug on both ends by using your advice, then on the bottom pin constraint I had to bring in the Y offset just a bit. Here's a screen of what I'm talking about:
It would still be nice to know about what the white box is at runtime, what is it visualizing in the editor there?
Thanks again!
The white box is the bounding box of all particles in the solver. So if you had multiple ropes in the same solver, it would enclose them all. This is mainly used for frustum culling.
If your cubes are colliders, then the issue is probably that the first / last particles in the rope are colliding against them, and being forced out of collision. If you add a ObiParticleRenderer component to the rope (so that its particles are drawn) and run the scene, this should be quite apparent.
The solution for this is to set the first/last particles in the same collision phase as the cubes, so that they ignore collisions against them. You set the phase value for individual particles using the particle editor. See:
http://obi.virtualmethodstudio.com/tutor...sions.html
http://obi.virtualmethodstudio.com/tutor...iting.html
Alternatively, if you do not need the cubes to collide with the rest of the rope at all, you can just change their phase instead. As long as the rope particles' phase and the collider's phase are the same, they won't collide.
|