26 lines
501 B
C#
26 lines
501 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class BulletMoving : MonoBehaviour
|
|
{
|
|
public GameObject parent;
|
|
|
|
public BulletScript bulletScript;
|
|
|
|
public 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 = bulletScript.direction * bulletScript.speed;
|
|
}
|
|
}
|