// Use this for initialization void Start() { player = FindObjectOfType <PlayerMomentumAgain>(); //Get the animator, attached to the GameObject you are intending to animate. m_Animator = gameObject.GetComponent <Animator>(); maxspeed = player.maxspeed; }
// Use this for initialization void Start() { player = FindObjectOfType <PlayerMomentumAgain>(); //Fetch the SpriteRenderer of the Sprite m_SpriteRenderer = GetComponent <SpriteRenderer>(); m_SpriteRenderer.sprite = sprite1; //Output the current Texture of the Sprite (this returns the source Sprite if the Texture isn't packed) }
char dir = 'R'; //1 equals right // Use this for initialization void Start() { player = FindObjectOfType <PlayerMomentumAgain>(); }