I have a scriptable object which has a list of other scriptable objects and I am trying to reach it from another script to do some calculations. When I try to assign the float that the scriptable objects should return it gives this error but when I try to print it, it works fine. How can unity print a float but can’t use it?
The error: Object referance not set to instance of an object.
The code that gives error:
ChpPVote = allCityScriptabelData.AllCityScriptableObjects[cityNumber].ChpVotes[0];
The code that works just fine:
print(allCityScriptabelData.AllCityScriptableObjects[cityNumber].ChpVotes[0]);