Skip to content

Instantly share code, notes, and snippets.

@AmmarTee
Created December 19, 2022 07:39
Show Gist options
  • Save AmmarTee/d0ec4a5c3eef461dbd4b90b26df2f5cf to your computer and use it in GitHub Desktop.
Save AmmarTee/d0ec4a5c3eef461dbd4b90b26df2f5cf to your computer and use it in GitHub Desktop.
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