Hello! I am making Space Shooter game using tutorials.
I have already prepared a Laser Bolt. I want to move it Forward, but it is not working even after using “transform.forward”.
I’ve tried it in its all possible Syntax but nothing happens. Please Help.!
My Script is:-
using UnityEngine;
using System.Collections;
public class Mover : MonoBehaviour
{
public Rigidbody rt;
public float Speed; //To set Speed of the Bolt…
void start()
{
rt = GetComponent<Rigidbody> (); // I need to use this code because I cannot use "rigibody"
}
void FixedUpdate()
{
rt.velocity = transform.forward * Speed;
}
}
Please Help!!