What is the proper way to use public variables and should I use public variables, or are there better alternatives for this?

What is the proper way to use public variables and should I use public variables, or are there better alternatives for this?

Normally I would set my bool variables private if they will only be referenced within the script, but if I want my other scripts to be informed about the bool variable, then I should definitely set my private bool to public, so that other scripts can access that variable and read it.

Here, I want my object to know whether the other object is running or not. I will not use event delegates, since public variables are actually required for this situation.

You can expose a getter for you bool , that way , other scripts can read the value but can’t change it.
Something like this

public class MyClass 
{
   private bool myBool;
   // this is a getter that exposes "myBool" as readonly
   public bool MyBool { get { return myBool; }}
   // short form of the getter above
   public bool MyBool => myBool;
}

EDIT :
About your second question , you can create a getter for each field (not really a fan of telling people what they can and can’t do with code).

There’s another convenient way to do this , that is to wrap your state variables in a struct and other script can take a copy of it.

public struct PlayerState
{
  public bool isJumping;
  public bool isHitting;
  public bool isFalling;
  // etc ...
}

public class Player
{
    private PlayerState state;
    public PlayerState State => state;
}

The advantage of doing that is that structs (unlike classes) use assignment by copy , which means if you do this …

// imagine this is called from another script
PlayerState stateCopy = player.State;

… the State getter actually returns a brand new copy of it’s internal state , in other words stateCopy doesn’t point to player.state , so changing values in stateCopy wont affect the player’s state.

This trick is also used for methods that would take a lot of arguments , a lot of APIs just create a struct that wraps the parameters needed and ask for that instead.
Feel free to google “passing by value vs reference” for more info.