So I have a block of code which is being passed an enum from anothe c# script. Everything is working fine apart from one little thing which is settng leftHandState and rightHandState to the passed enum value. I have debug.log the incoming variables hLeft and hRight and they return the correct enum. But when I go to make leftHandState or rightHandState = to the passed enum value they do not change but stay at the default value for the enum.
This is the code for the specific file below:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public enum HandStates { Default, Fist, ThumbUp, PointingThumbUp, Pointing, IndexFinger };
public class SystemManager : MonoBehaviour
{
//GameObject States
public CasualtyState casualtyState;
//hand Presence
private HandStates leftHandState;
private HandStates rightHandState;
public WristReturnMenu wristReturnMenu;
public void SetLeftHandState(HandStates hLeft) {
Debug.Log(hLeft); //This is logging the correct enum value
leftHandState = hLeft;
Debug.Log(leftHandState); //This isn't changing
}
public void SetRightHandState(HandStates hRight) {
rightHandState = hRight;
}
private void Update() {
Debug.Log("Left Hand State: " + leftHandState);
Debug.Log("Right Hand State: " + rightHandState);
}
}