1
0
Fork 0
boss-room/Assets/Scenes/Scripts/FireballSpawner.cs
2021-07-10 17:13:13 -05:00

23 lines
653 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class FireballSpawner : MonoBehaviour
{
public GameObject dragonHead;
public GameObject fireball;
void Update()
{
if (Input.GetMouseButtonDown(0))
{
Vector3 mouseClickFromCamera = Camera.main.ScreenToWorldPoint(Input.mousePosition);
mouseClickFromCamera.z = 0;
GameObject spawnedFireball = Instantiate(fireball, dragonHead.transform.position, Quaternion.identity);
Debug.Log(mouseClickFromCamera);
Debug.Log(dragonHead.transform.position);
/* gameObject.transform.position = pz; */
}
}
}