Add a ragdoll attachment to the rope's end - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html) +--- Thread: Add a ragdoll attachment to the rope's end (/thread-3154.html) Pages:
1
2
|
Add a ragdoll attachment to the rope's end - lacasrac - 27-10-2021 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? RE: Add a ragdoll attachment to the rope's end - josemendez - 27-10-2021 (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. 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/manual/6.2/attachments.html RE: Add a ragdoll attachment to the rope's end - lacasrac - 28-10-2021 (27-10-2021, 10:48 AM)josemendez Wrote: Hi! 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 RE: Add a ragdoll attachment to the rope's end - josemendez - 28-10-2021 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. RE: Add a ragdoll attachment to the rope's end - lacasrac - 29-10-2021 (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? 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 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. RE: Add a ragdoll attachment to the rope's end - josemendez - 29-10-2021 (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 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. RE: Add a ragdoll attachment to the rope's end - lacasrac - 29-10-2021 (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. Thanks! It looks like calling isKinematic solved the probleme! RE: Add a ragdoll attachment to the rope's end - lacasrac - 30-10-2021 (29-10-2021, 07:01 PM)lacasrac Wrote: Thanks! It looks like calling isKinematic solved the probleme! 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 RE: Add a ragdoll attachment to the rope's end - josemendez - 01-11-2021 (30-10-2021, 09:23 AM)lacasrac Wrote: Also I got a lot of error messages in the log: I believe this is a known and already fixed bug, see the following thread for a patch: http://obi.virtualmethodstudio.com/forum/thread-3071-post-10768.html?highlight=ObjectDisposedException#pid10768 RE: Add a ragdoll attachment to the rope's end - lacasrac - 01-11-2021 (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: Thanks, that is working. but I have a new one 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 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... |