Created
December 19, 2022 07:39
-
-
Save AmmarTee/d0ec4a5c3eef461dbd4b90b26df2f5cf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class weapon : MonoBehaviour | |
{ | |
// Start is called before the first frame update | |
public GameObject fireBalls; | |
void Update() | |
{ | |
if(Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.Space)) | |
{ | |
Debug.Log("Pressed Mouse Button 1"); | |
Instantiate(fireBalls,new Vector3(this.transform.position.x,this.transform.position.y,this.transform.position.z+1),Quaternion.identity); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment