- Home /
How to draw a Sprite next to theplayer
OK so i am trying to make a fireball launch from the player once the player presses the 'z' key. Code: using System.Collections; using System.Collections.Generic; using UnityEngine; public class launchfireball : MonoBehaviour { public Sprite fireBall; public Transform fireBallStart; // Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Z)){ GetComponent().sprite = fireBall; Debug.Log("Fire Ball Launched!"); }
}
} How would I draw the sprite on top of a transform, do i need to find the coordinates of the transform to draw on top of it?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612233019im_/https://answers.unity.com/themes/thub/images/avi.jpg)