21 lines
471 B
C#
21 lines
471 B
C#
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;
|
|
}
|
|
}
|
|
}
|