Heroes_of_Hiis/Assets/Project Files/Scripts/JonasB/spellcaster.cs

21 lines
471 B
C#
Raw Normal View History

2022-03-24 16:02:34 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class spellcaster : MonoBehaviour
{
public GameObject projectile;
public float projectileSpeed;
void Update()
{
if (true)
{
GameObject icebolt = Instantiate(projectile, transform) as GameObject;
Rigidbody rb = icebolt.GetComponent<Rigidbody>();
rb.velocity = transform.forward * projectileSpeed;
}
}
}