i seem to be having trouble checking from another object if the player is grounded.
I have a Character Controller on the player and tryed to get the access it as a component,
Im probably missing something simple and cant see it.
var Player : GameObject; var FollowY: boolean = true; var FollowX: boolean = true; function Start () { Player = GameObject.Find("Player"); var charController : CharacterController = Player.GetComponent(CharacterController); } function Update () { if(FollowY == true) { if(charController.isGrounded == true) { transform.position.y = (Mathf.Lerp(transform.position.y, Player.transform.position.y, Time.time)); } } if(FollowX == true) { transform.position.x = Player.transform.position.x; } }