1
0
Fork 0
boss-room/Assets/Scenes/Scripts/Fireball.cs
2021-07-10 17:24:26 -05:00

21 lines
424 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Fireball : MonoBehaviour
{
public float speed = 1.0f;
public Vector2 destination;
void Start()
{
Debug.Log("Fireball destination:");
Debug.Log(destination);
}
void Update()
{
float step = speed * Time.deltaTime;
transform.position = Vector3.MoveTowards(transform.position, destination, step);
}
}