Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can't delete connection
#1
Thumbs Up 
I have a gameobject following two connected splines. Splines are connected at runtime. When the object is destroyed I want to disconnect the splines. I have the following code;

Code:
            
pooledObject.SplineController.Stop();
if (pooledObject.SplineConnection != null)
{
     ObjectExt.Destroy(pooledObject.SplineConnection, false, false);
}

When the code is called I get the following error;

Destroying components immediately is not permitted during physics trigger/contact, animation event callbacks, rendering callbacks or OnValidate. You must use Destroy instead.
UnityEngine.ObjectBig GrinestroyImmediate (UnityEngine.Object)

What checks do I need to do to make sure I can delete the connection?

Thanks
Reply


Messages In This Thread
Can't delete connection - by lacota - 03-14-2024, 05:56 PM
RE: Can't delete connection - by _Aka_ - 03-15-2024, 08:56 PM
RE: Can't delete connection - by lacota - 03-16-2024, 12:20 AM
RE: Can't delete connection - by _Aka_ - 03-16-2024, 11:34 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Lightbulb Junction & Connection Navigation System Design SAMYTHEBIGJUICY 6 3,442 03-25-2026, 10:10 PM
Last Post: _Aka_
  Anomalous connection handling SAMYTHEBIGJUICY 1 1,346 12-04-2024, 05:08 PM
Last Post: _Aka_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 2,627 03-18-2024, 07:55 PM
Last Post: _Aka_
  Connection "next' control point jh092 3 2,120 11-22-2023, 11:47 AM
Last Post: _Aka_

Forum Jump: