Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  Destroying GameObjects immediately is not permitted during physics trigger/contact
#2
(17-09-2024, 01:14 PM)Alexander34 Wrote: I made a rope hitch like in the Hook example. And now every time I get this error in ObiCollisionWorld when I use the above AttachRope method.

Hi,

Where are you calling AttachRope() from? Judging from your stack trace, it would seem like you are doing this from OnTriggerStay() which is a trigger callback.

You're deleting the rope and creating it anew, this triggers the collision system destruction (the DestroyImmediate call) during a trigger callback, which as the error message itself is telling you isn't allowed:

Quote:Destroying GameObjects immediately is not permitted during physics trigger/contact

Simplest workaround is to store the condition using a boolean, and attach the rope during Update() or some other callback that's not part of the triggers/collision system.

kind regards,
Reply


Messages In This Thread
RE: Destroying GameObjects immediately is not permitted during physics trigger/contact - by josemendez - 17-09-2024, 01:30 PM