using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerFire : MonoBehaviour { float moveSpeed = 25f; Rigidbody2D rb; Monster target; Vector2 moveDirection; public float firespeed; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { transform.Translate(Vector2.right * firespeed * Time.deltaTime, Space.Self); } private void OnCollisionEnter2D(Collision2D collision) { Debug.Log(collision.transform.name); Destroy(gameObject); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)