Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add a ragdoll attachment to the rope's end
#1
I have a ragdoll but when I attaching to my rope's end, the ragdoll just falling down.
Can I attach it? How?

I need to my character hanging on the last rope's segment. Basically I want to attach one of his body part to the rope's end.
Let's say: neck, or just the "2 foot" or "2 hand".

Can you help me in this?
Reply
#2
(27-10-2021, 10:46 AM)lacasrac Wrote: I have a ragdoll but when I attaching to my rope's end, the ragdoll just falling down.
Can I attach it? How?

I need to my character hanging on the last rope's segment. Basically I want to attach one of his body part to the rope's end.
Let's say: neck, or left hand, or just the right foot.

Can you help me in this?

Hi!

Just make sure you're using a dynamic attachment. If you use a static attachment, no force interplay between the rag doll/rigidbody and the rope will take place. The rag doll will just fall and the rope will follow it.

See: http://obi.virtualmethodstudio.com/manua...ments.html
Reply
#3
(27-10-2021, 10:48 AM)josemendez Wrote: Hi!

Just make sure you're using a dynamic attachment. If you use a static attachment, no force interplay between the rag doll/rigidbody and the rope will take place. The rag doll will just fall and the rope will follow it.

See: http://obi.virtualmethodstudio.com/manua...ments.html

Thanks, now it is working!

https://www.youtube.com/watch?v=HHRKaLTxA5M

I made a simple culling script (if distance between the camera and gameobject is more then XX then the gameobject will be disabled)

But I think if I enable/disable the solver/rope than will be a weird issue/BUG on the cutted rope.

Is it a BUG or how can I cull out the rope/solver if I don't need to draw? Also workaround for this force/cutted rope will be one again issue?

Thanks,
Leslie
Reply
#4
I assume that for some reason, the built-in culling (disabling "simulate when invisible" in the solver) does not work in your case?

Hard to tell from the video, but the issue might be the following:

If you disable the rope component, the rope will be taken out of the solver. When re-enabling it, it will be re-added to the solver all cuts will be reset. This is because cutting a rope does not permanently change the blueprint, it's a temporary change made to the actor itself. This is intentional, not a bug.

If this is the case, simply disable the solver component only (not the entire gameobject). This will stop the simulation while retaining the state of all currently loaded ropes.
Reply
#5
(28-10-2021, 01:40 PM)josemendez Wrote: I assume that for some reason, the built-in culling (disabling "simulate when invisible" in the solver) does not work in your case?

Hard to tell from the video, but the issue might be the following:

If you disable the rope component, the rope will be taken out of the solver. When re-enabling it, it will be re-added to the solver all cuts will be reset. This is because cutting a rope does not permanently change the blueprint, it's a temporary change made to the actor itself. This is intentional, not a bug.

If this is the case, simply disable the solver component only (not the entire gameobject). This will stop the simulation while retaining the state of all currently loaded ropes.


I tried that. If I disable only the solver, the rope remain in that state, but the body in the end falling down.
After I enable it again... The body will be in the end, but also a big force apply on the rope, so the rope suddenly moving with big speed Triste

Also if I disable simulate when invisible is the same behaviour like I mentioned before. Big force apply to the body in the end

Also the fps going down to 1-10 fps with the solution you mentioned. With my solution only enabled/disabled the gameobject the fps is 20-30 fps.
Reply
#6
(29-10-2021, 08:38 AM)lacasrac Wrote: I tried that. If I disable only the solver, the rope remain in that state, but the body in the end falling down.

Ofc you need to disable any objects attached to the rope too. If you just disable the solver, all objects in there won't have any ropes supporting them so will just fall to the ground. Rigidbody objects are not simulated by Obi so disabling the solver won't stop their simulation.

(29-10-2021, 08:38 AM)lacasrac Wrote: After I enable it again... The body will be in the end, but also a big force apply on the rope, so the rope suddenly moving with big speed Triste

Yep, that's the expected behavior if you disable the solver but not the attached objects. Once you re-enable the rope simulation, any stuff attached to the rope will spring back to it.


(29-10-2021, 08:38 AM)lacasrac Wrote: Also if I disable simulate when invisible is the same behaviour like I mentioned before. Big force apply to the body in the end

Other objects in the scene (rigidbodies) are not handled by Obi, so when the solver stops simulating the rope, rigidbodies will still be simulated by Unity. You need to deactivate them too.

(29-10-2021, 08:38 AM)lacasrac Wrote: Also the fps going down to 1-10 fps with the solution you mentioned. With my solution only enabled/disabled the gameobject the fps is 20-30 fps.

By disabling the entire game object hierarchy will lose any temporary state (cuts, length changes) in the rope. Disable the solver component only, then disable any other objects (rigidbodies) that interact with the simulation. This will result in *zero* work being done.
Reply
#7
(29-10-2021, 09:36 AM)josemendez Wrote: Ofc you need to disable any objects attached to the rope too. If you just disable the solver, all objects in there won't have any ropes supporting them so will just fall to the ground. Rigidbody objects are not simulated by Obi so disabling the solver won't stop their simulation.


Yep, that's the expected behavior if you disable the solver but not the attached objects. Once you re-enable the rope simulation, any stuff attached to the rope will spring back to it.



Other objects in the scene (rigidbodies) are not handled by Obi, so when the solver stops simulating the rope, rigidbodies will still be simulated by Unity. You need to deactivate them too.


By disabling the entire game object hierarchy will lose any temporary state (cuts, length changes) in the rope. Disable the solver component only, then disable any other objects (rigidbodies) that interact with the simulation. This will result in *zero* work being done.

Thanks! It looks like calling isKinematic solved the probleme! Sonrisa
Reply
#8
(29-10-2021, 07:01 PM)lacasrac Wrote: Thanks! It looks like calling isKinematic solved the probleme! Sonrisa

Also I got a lot of error messages in the log:

ObjectDisposedException: Cannot access a disposed object.
Object name: 'The NativeArray has been disposed, it is not allowed to access it'.
Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckExistsAndThrow (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle& handle) (at <07c89f7520694139991332d3cf930d48>:0)
Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.ValidateNonDefaultHandle (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle& handle) (at <07c89f7520694139991332d3cf930d48>:0)
Unity.Collections.NativeArray`1[T].get_Length () (at <07c89f7520694139991332d3cf930d48>:0)
Obi.BurstColliderCollisionConstraints.GetConstraintCount () (at Assets/Obi/Scripts/Common/Backends/Burst/Constraints/ColliderCollision/BurstColliderCollisionConstraints.cs:30)
Obi.BurstSolverImpl.GetConstraintCount (Oni+ConstraintType type) (at Assets/Obi/Scripts/Common/Backends/Burst/Solver/BurstSolverImpl.cs:405)
Obi.ObiSolver.EndStep (System.Single substepTime) (at Assets/Obi/Scripts/Common/Solver/ObiSolver.cs:1577)
Obi.ObiUpdater.EndStep (System.Single substepDeltaTime) (at Assets/Obi/Scripts/Common/Updaters/ObiUpdater.cs:92)
Obi.ObiFixedUpdater.FixedUpdate () (at Assets/Obi/Scripts/Common/Updaters/ObiFixedUpdater.cs:52)

Can I fix it somehow? Thanks
Reply
#9
(30-10-2021, 09:23 AM)lacasrac Wrote: Also I got a lot of error messages in the log:

ObjectDisposedException: Cannot access a disposed object.
Object name: 'The NativeArray has been disposed, it is not allowed to access it'.
Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckExistsAndThrow (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle& handle) (at <07c89f7520694139991332d3cf930d48>:0)
Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.ValidateNonDefaultHandle (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle& handle) (at <07c89f7520694139991332d3cf930d48>:0)
Unity.Collections.NativeArray`1[T].get_Length () (at <07c89f7520694139991332d3cf930d48>:0)
Obi.BurstColliderCollisionConstraints.GetConstraintCount () (at Assets/Obi/Scripts/Common/Backends/Burst/Constraints/ColliderCollision/BurstColliderCollisionConstraints.cs:30)
Obi.BurstSolverImpl.GetConstraintCount (Oni+ConstraintType type) (at Assets/Obi/Scripts/Common/Backends/Burst/Solver/BurstSolverImpl.cs:405)
Obi.ObiSolver.EndStep (System.Single substepTime) (at Assets/Obi/Scripts/Common/Solver/ObiSolver.cs:1577)
Obi.ObiUpdater.EndStep (System.Single substepDeltaTime) (at Assets/Obi/Scripts/Common/Updaters/ObiUpdater.cs:92)
Obi.ObiFixedUpdater.FixedUpdate () (at Assets/Obi/Scripts/Common/Updaters/ObiFixedUpdater.cs:52)

Can I fix it somehow? Thanks

I believe this is a known and already fixed bug, see the following thread for a patch:
http://obi.virtualmethodstudio.com/forum...n#pid10768
Reply
#10
(01-11-2021, 09:29 AM)josemendez Wrote: I believe this is a known and already fixed bug, see the following thread for a patch:
http://obi.virtualmethodstudio.com/forum...n#pid10768

Thanks, that is working. but I have a new one Gran sonrisa

NullReferenceException: Object reference not set to an instance of an object
Obi.ObiBoxShapeTracker.UpdateIfNeeded () (at Assets/Obi/Scripts/Common/Collisions/ColliderTrackers/Trackers3D/ObiBoxShapeTracker.cs:36)
Obi.ObiColliderBase.UpdateIfNeeded () (at Assets/Obi/Scripts/Common/Collisions/ObiColliderBase.cs:185)
Obi.ObiColliderWorld.UpdateColliders () (at Assets/Obi/Scripts/Common/Collisions/ObiColliderWorld.cs:361)
Obi.ObiUpdater.BeginStep (System.Single stepDeltaTime) (at Assets/Obi/Scripts/Common/Updaters/ObiUpdater.cs:40)
Obi.ObiFixedUpdater.FixedUpdate () (at Assets/Obi/Scripts/Common/Updaters/ObiFixedUpdater.cs:44)

Sometimes when I click on the Play button (and load more then 5-10 seconds Unity 2020 for the first time) I get this (999+)

But 10/9 it is working... But that 10/1 is the probleme. When this error happening, the body on the rope's end just falling down....
Can you help me in this too? What is the probleme here?

(01-11-2021, 06:05 PM)lacasrac Wrote: Thanks, that is working. but I have a new one Gran sonrisa

NullReferenceException: Object reference not set to an instance of an object
Obi.ObiBoxShapeTracker.UpdateIfNeeded () (at Assets/Obi/Scripts/Common/Collisions/ColliderTrackers/Trackers3D/ObiBoxShapeTracker.cs:36)
Obi.ObiColliderBase.UpdateIfNeeded () (at Assets/Obi/Scripts/Common/Collisions/ObiColliderBase.cs:185)
Obi.ObiColliderWorld.UpdateColliders () (at Assets/Obi/Scripts/Common/Collisions/ObiColliderWorld.cs:361)
Obi.ObiUpdater.BeginStep (System.Single stepDeltaTime) (at Assets/Obi/Scripts/Common/Updaters/ObiUpdater.cs:40)
Obi.ObiFixedUpdater.FixedUpdate () (at Assets/Obi/Scripts/Common/Updaters/ObiFixedUpdater.cs:44)

Sometimes when I click on the Play button (and load more then 5-10 seconds Unity 2020 for the first time) I get this (999+)

But 10/9 it is working... But that 10/1 is the probleme. When this error happening, the body on the rope's end just falling down....
Can you help me in this too? What is the probleme here?

It looks like the error there when:

1, In Rider I update a script -> Unity 2020 refreshing the scripts (Hold on...dialog)
2, Start btn press first time -> 5-10 seconds wait then the error come

If I not change anaything on the script, so I press the Play button more the error not present...
So the first time is the issue here...
Reply