17-09-2024, 02:13 PM
(17-09-2024, 01:30 PM)josemendez Wrote: Hi,Yes cashing bool and use it in update was helpful, thank's.
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:
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,
But perhaps, we can unload rope more safe?