aboutsummaryrefslogtreecommitdiffstats
path: root/Assets/Scripts/Projectile.cs
blob: 76929173973de1c01d8eb733d760b550c398c229 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MontanaJohns.Actors;

public class Projectile : MonoBehaviour
{
    public float speed = 60f;
    public Rigidbody2D rb;

    // Start is called before the first frame update
    void Start()
    {
        rb.velocity = transform.right * speed;
    }

    private void OnCollisionEnter2D(Collision2D collision)
    {
        Destroy(gameObject);
    }
}