Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Null Reference, actor not loading
#2
Hi,

These are two separate errors.

(13-12-2024, 12:19 PM)alicecatalano Wrote: NullReferenceException: Object reference not set to an instance of an object
DistanceAnchor.CheckAndAnchorParticles () (at Assets/Scripts/DistanceAnchor.cs:43)
ForcepsControl.Update () (at Assets/Scripts/ForcepsControl.cs:48)

This is a null reference on DistanceAnchor line 43. Most likely, "actor" or "actor.solverIndices" is null because the actor has not been loaded into any solver yet.

(13-12-2024, 12:19 PM)alicecatalano Wrote: Actor is not loaded
UnityEngine.Debug:LogError (object)
DistanceAnchor:CheckAndAnchorParticles () (at Assets/Scripts/DistanceAnchor.cs:39)
ForcepsControl:UpdateThimbleRotation () (at Assets/Scripts/ForcepsControl.cs:70)
ForcepsControl:Update () (at Assets/Scripts/ForcepsControl.cs:51)

This simply means the actor has not been loaded by any solver.

Could be that there's no solver to be found up the actor's hierarchy, or that the actor's OnEnable (which is where the actor gets loaded) hasn't been called yet by the time your script's CheckAndAnchorParticles() is called. Keep in mind that the order in which Unity calls events for different components is undefined, this means your script's OnEnable(), Awake(), etc could be called before or after any other script's.

kind regards,
Reply


Messages In This Thread
RE: Null Reference, actor not loading - by josemendez - 13-12-2024, 12:39 PM