Unity-SpaceShooter/Assets/Scripts/Mover.cs

14 lines
262 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Mover : MonoBehaviour
{
public float Speed;
private Rigidbody rb;
void Start()
{
rb = GetComponent<Rigidbody>();
rb.velocity = transform.forward * Speed;
}
}