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
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
Lightbulb Junction & Connection Navigation System Design SAMYTHEBIGJUICY 4 13 11-27-2023, 01:04 PM
Last Post: _Aka_
  Connection "next' control point jh092 3 15 11-22-2023, 11:47 AM
Last Post: _Aka_
  insecure connection refused schema 1 2 05-03-2023, 12:30 PM
Last Post: _Aka_

Forum Jump: