I am trying to make the character fire some waves through the weapon when you click the mouse button, but somehow the waves (projectiles) are not showing in the screen even though the hierarchy shows that its being cloned, I'm new to unity so I dont understand what's the problem. This is the code I'm using:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class weapon : MonoBehaviour {
public GameObject projectile;
public Transform shotPoint;
private void Update()
{
if(Input.GetMouseButtonDown(0)){
Instantiate(projectile, shotPoint.position, transform.rotation);
}
}
}
I'd be thankful if someone can help me.