Accessing a variable from a namespace to a Monobehaviour class.

I have a script which is in a namespace. HandTrackingValue.cs

using System.Collections.Generic;
using UnityEngine;
namespace Mediapipe.Unity.HandTracking
{
    public class HandTrackingValue
    {
        public readonly List<Detection> palmDetections;
        public readonly List<NormalizedRect> handRectsFromPalmDetections;
        public readonly List<NormalizedLandmarkList> handLandmarks;
        public readonly List<LandmarkList> handWorldLandmarks;
        public readonly List<NormalizedRect> handRectsFromLandmarks;
        public readonly List<ClassificationList> handedness;
        public string value;

        public HandTrackingValue(List<Detection> palmDetections, List<NormalizedRect> handRectsFromPalmDetections,
                                 List<NormalizedLandmarkList> handLandmarks, List<LandmarkList> handWorldLandmarks,
                                 List<NormalizedRect> handRectsFromLandmarks, List<ClassificationList> handedness)
        {
            
            this.handedness = handedness;              
        }
        void Update()
        {
            value = handedness.Count.ToString();
        }
    }

}

I have another script which is in a MonoBehaviour. This script below , ShootingStuff.cs is trying to access “value” variable from the above script. But it is throwing " Not set to instance of an object".
ShootingStuff.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Mediapipe.Unity.HandTracking;
public class ShootingStuff : MonoBehaviour
{
    Mediapipe.Unity.HandTracking.HandTrackingValue a;
    void Start()
    {
      
    }    
    void Update()
    {
        Debug.Log(a.value.ToString());        
    }
}

Both of these scripts are in Scripts folder. But, ShootingStuff.cs is directly within Scripts folder whereas HandtrackingValue.cs is in Scripts->HandTrackingFolder->HandTrackingValue.cs.

I am unable to access “value” from HandTrackingValue.cs into ShootingStuff.cs. WHere am I going wrong?

You haven’t initialized your Mediapipe.Unity.HandTracking.HandTrackingValue object in your code. SInce it doesn’t inherit from monobehaviour, it can’t be initialized in the editor. You’ll have to manually call the constructor in your start method for example:

void Start()
{
     // Initialize with valid parameters
     a = new Mediapipe.Unity.HandTracking.HandTrackingValue(...);
}

Then, you’ll also need to call a.Update() in your ShootingStuff Update() method, since Update() isn’t called automatically in a non-monobehaviour script.
@qoalgamedev