How can i use the Public Onground bool in another script
public class playerController : MonoBehaviour {
public float movementSpeed;
public float lookSpeed;
public float jumpHeight;
public bool Onground;
public Rigidbody playerRB;
public GameObject GCD;
1 Answer
1
In your other script, declare public playerContoller myPlayerController;, then in the inspector of your other script, drag and drop your PlayerController game object to the My Player Controller field.
You are now able to fully access Onground by writing myPlayerContoller.Onground in your other script.