I have a problem with the OnMouseDown() function
unfortunately it doesn’t work for me and I have no idea, could someone please send me the code to make it work for me instead of this one
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Waypoint : MonoBehaviour
{
[SerializeField] GameObject towerPrefab;
[SerializeField] bool isPlaceable;
void OnMouseDown()
{
if(isPlaceable)
{
Instantiate(towerPrefab,transform.position,Quaternion.identity);
}
}
}