PBG2H23ABR_PBG2H23AKL_PMC_P.../Plunderblock/Assets/Scripts/ScriptsKevin/BulletMoving.cs
2024-06-14 10:35:34 +02:00

26 lines
514 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BulletMoving : MonoBehaviour
{
public GameObject parent;
public DataBullet dataBullet;
[SerializeField]
private Rigidbody rb;
private
// Start is called before the first frame update
void Start()
{
rb = parent.GetComponent<Rigidbody>();
}
// Update is called once per frame
void Update()
{
rb.velocity = dataBullet.direction * dataBullet.speed;
}
}