private void Start() { cannonObj = this.gameObject; animator = GetComponent <Animator>(); cannon = cannonObj.GetComponent <Cannon>(); StartCoroutine(MinHjärnaDog()); elevationCheck = FindClosetElevationCheck.GetClosets(gameObject); }
void Start() { ElevationCheck elevationCheck = FindClosetElevationCheck.GetClosets(gameObject); float heightPercentense = elevationCheck.groundlevel + restictValue; var pos = transform.position; pos.y = heightPercentense + 0.5f; transform.position = pos; }