Can someone please help me with this shooting script i am working on? I have no idea what i am doing.
using UnityEngine;
using System.Collections;
public class Bullet : MonoBehaviour
{
var Fire;
// Use this for initialization
void Start ()
{
var Fire = false;
}
// Update is called once per frame
void Update ()
{
if (GetMouseDown = true);
{
var Fire = true
}
if (Fire = true);
{
Spawn object laser
}
}
}
I don’t know what you want because your question was so vague, but here’s a great tutorial on how to create a gun in Unity. The code formatting is horrendous but you’ll get the idea