Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Some questions & requests
#16
(09-08-2022, 04:51 PM)landosilva Wrote: Hey Jose! It's me again! ^^'

I'm now trying to simply detach the rope but I'm having some problems.

If I call Disconnect() from the example the rope is not being detached at all. Both attachments are disabled and with their targets null but they are still behaving like it was attached. 

Code:
public void Disconnect()
{
    _attachment1.target = null;
    _attachment2.target = null;
    _attachment1.enabled = false;
    _attachment2.enabled = false;
}

First disable the attachment, then you may set its target to null. Otherwise you're pulling the rug from under the attachment's feet, so to speak, as it loses the reference to the target and can no longer disable the underlying constraint. Note this is a special case, when you set the target to a different object, the attachment will swap targets.

(09-08-2022, 04:51 PM)landosilva Wrote: Also, if I call Despawn (setting the rope's object to false) in a OnTriggerEnter event, and I'm getting this error:

Removing the last rope from the last solver in the scene will destroy the BurstColliderWorld object in the scene, as it's no longer used. This is an object that keeps track of colliders/rigidbodies in the scene and syncs them with Obi. It must be destroyed using DestroyImmediate() as it must exist in-editor, but it cannot be immediately destroyed during a contact callback since that would remove objects mid-simulation. I would recommend enabling a flag variable during collision, then destroy the rope in Update().

kind regards,
Reply


Messages In This Thread
Some questions & requests - by landosilva - 04-08-2022, 10:58 PM
RE: Some questions & requests - by josemendez - 05-08-2022, 07:57 AM
RE: Some questions & requests - by landosilva - 05-08-2022, 03:34 PM
RE: Some questions & requests - by josemendez - 05-08-2022, 04:17 PM
RE: Some questions & requests - by landosilva - 06-08-2022, 02:59 PM
RE: Some questions & requests - by josemendez - 08-08-2022, 07:44 AM
RE: Some questions & requests - by landosilva - 08-08-2022, 09:46 AM
RE: Some questions & requests - by josemendez - 08-08-2022, 10:54 AM
RE: Some questions & requests - by landosilva - 08-08-2022, 02:09 PM
RE: Some questions & requests - by josemendez - 08-08-2022, 02:24 PM
RE: Some questions & requests - by landosilva - 08-08-2022, 02:56 PM
RE: Some questions & requests - by josemendez - 08-08-2022, 03:21 PM
RE: Some questions & requests - by landosilva - 08-08-2022, 03:44 PM
RE: Some questions & requests - by josemendez - 08-08-2022, 03:46 PM
RE: Some questions & requests - by landosilva - 09-08-2022, 04:51 PM
RE: Some questions & requests - by josemendez - 10-08-2022, 07:18 AM
RE: Some questions & requests - by landosilva - 10-08-2022, 10:03 AM
RE: Some questions & requests - by josemendez - 10-08-2022, 10:15 AM
RE: Some questions & requests - by josemendez - 10-08-2022, 10:39 AM