In the State Machine script I am trying to access the IState interface from PlayerAirborneState (the last compoenent in the inspector). Here’s my code. AccessAirborneInterface, C# - rextester
This however accesses the IState interface that is implemented in the top most component that implements IState. And I know this because I ran Debug.Log(airborne); and it outputted "Player (PlayerWalkState)"
For debugging, I tried moving the airborne state component to the top and got the output “Player (PlayerAirborneState)”. So I think Unity is just taking the first component that implements IState and using that.
How can I access the IState Interface from the PlayerAirborneState component without switching the order of components in the inspector?