Posts: 11
Threads: 3
Joined: Dec 2019
Reputation:
0
13-12-2019, 10:58 AM
[attachment=549]
I have object that need a rope to hook a load to move. I have to have the red circle in different position too.
In A,
If I change the position of the red circle, sometimes the rope stays there hanging the load. Is there anyway to update/reset, so it definitely follow the red circle? There are other time where it does follow, but the rope is swinging a lot. Is there any function to call that stop the swinging? It is just for a reset only.
In B,
If I have both of the them being fixed, the load just drops immediately, I don't know which way is the right way to set the joints up. Any suggestion?
Thanks.
Posts: 6,321
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
13-12-2019, 11:16 AM
(This post was last modified: 13-12-2019, 11:17 AM by josemendez.)
(13-12-2019, 10:58 AM)LORDeveloper Wrote: I have object that need a rope to hook a load to move. I have to have the red circle in different position too.
In A,
If I change the position of the red circle, sometimes the rope stays there hanging the load. Is there anyway to update/reset, so it definitely follow the red circle? There are other time where it does follow, but the rope is swinging a lot. Is there any function to call that stop the swinging? It is just for a reset only.
In B,
If I have both of the them being fixed, the load just drops immediately, I don't know which way is the right way to set the joints up. Any suggestion?
Thanks.
Assuming you're using Obi 5.0: Attach the rope to the red circle using a static attachment, and attach it to the box using a dynamic attachment (since you need two-way coupling between the blue box and the rope!)
Also, make sure you move the circle during FixedUpdate(), or you'll experience a 1-frame delay. Physics are always (expect in special cases) updated in FixedUpdate(), not Update() or LateUpdate().
To make the rope swing less, increase the solver's damping.
Posts: 11
Threads: 3
Joined: Dec 2019
Reputation:
0
(13-12-2019, 11:16 AM)josemendez Wrote: Assuming you're using Obi 5.0: Attach the rope to the red circle using a static attachment, and attach it to the box using a dynamic attachment (since you need two-way coupling between the blue box and the rope!)
Also, make sure you move the circle during FixedUpdate(), or you'll experience a 1-frame delay. Physics are always (expect in special cases) updated in FixedUpdate(), not Update() or LateUpdate().
To make the rope swing less, increase the solver's damping.
Does it have to be updating position in FixedUpdate function, because I am doing reset function where I was hoping I can do something like transform.position = Vector.Zero. And that reset its position and everything, otherwise player will need to wait for the object to move.
Posts: 6,321
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
13-12-2019, 12:08 PM
(This post was last modified: 13-12-2019, 12:09 PM by josemendez.)
(13-12-2019, 12:06 PM)LORDeveloper Wrote: Does it have to be updating position in FixedUpdate function, because I am doing reset function where I was hoping I can do something like transform.position = Vector.Zero. And that reset its position and everything, otherwise player will need to wait for the object to move.
Oh, I misunderstood. So what you want to do is teleport the entire thing to a new position.
Easiest way is to have everything (circle, rope and box) parented under the solver. Then, simply move the solver around anytime you like.
Posts: 11
Threads: 3
Joined: Dec 2019
Reputation:
0
(13-12-2019, 12:08 PM)josemendez Wrote: Oh, I misunderstood. So what you want to do is teleport the entire thing to a new position.
Easiest way is to have everything (circle, rope and box) parented under the solver. Then, simply move the solver around anytime you like.
Hi, I set it up like you were told. But the load ended up swinging itself miles away.
Posts: 6,321
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(13-12-2019, 12:31 PM)LORDeveloper Wrote: Hi, I set it up like you were told. But the load ended up swinging itself miles away.
Shouldn't, if the setup is correct: both objects and the rope under the solver. Here's a video:
Posts: 11
Threads: 3
Joined: Dec 2019
Reputation:
0
(13-12-2019, 12:55 PM)josemendez Wrote: Shouldn't, if the setup is correct: both objects and the rope under the solver. Here's a video:
Thanks, I ended up creating a new rope at run time when I do reset. I used your sample script from the rope and hook demo, and it works! However there is a small problem with tangent issue.
[attachment=552]
When I increase the rope length its tangent mode is causing the object getting far away from the rope original point when the box is at an angle. (See blue line)
I want to react like the green line. How can I change it when creating the rope on script?
Posts: 6,321
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(16-12-2019, 04:53 PM)LORDeveloper Wrote: Thanks, I ended up creating a new rope at run time when I do reset. I used your sample script from the rope and hook demo, and it works! However there is a small problem with tangent issue.
When I increase the rope length its tangent mode is causing the object getting far away from the rope original point when the box is at an angle. (See blue line)
I want to react like the green line. How can I change it when creating the rope on script?
Hi! Sorry but I don't understand the problem. Could you post a video?
Also, what do you mean by tangent mode? tangents in the rope spline have to effect whatsoever at runtime, they only determine the initial rope shape.
Posts: 11
Threads: 3
Joined: Dec 2019
Reputation:
0
(16-12-2019, 05:24 PM)josemendez Wrote: Hi! Sorry but I don't understand the problem. Could you post a video?
Also, what do you mean by tangent mode? tangents in the rope spline have to effect whatsoever at runtime, they only determine the initial rope shape.
As you can see I create the rope at run time using script. And then when I rotate it and extend its length, the rope has a tangent that taking my ball far away.
Posts: 6,321
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(17-12-2019, 10:32 AM)LORDeveloper Wrote:
As you can see I create the rope at run time using script. And then when I rotate it and extend its length, the rope has a tangent that taking my ball far away.
You've probably placed the cursor "source" over a fixed particle (if left at 0, and the first particle is fixed by an attachment, the cursor will generate fixed particles). Place the source elsewhere in the rope, so that it creates regular particles instead.
|