- Home /
Space Shooter Bolts v5
So I'm following the tutorial on shooter and I'm on 1.6, where I make some code for the bolt. Here is my code: enter code here
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class Controller : MonoBehaviour { public float speed;
void Start()
{
rb = GetComponent<Rigidbody>();
rb.velocity = transform.forward * speed;
}
}
However, I get an error saying that they can't find "rb". However, this code has worked in my player controller. Was wondering if I could borrow anyone elses v5 code.
Your answer
Follow this Question
Related Questions
Why is my game connecting to config.uca.cloud.unity3d.com on startup after recent Unity update? 2 Answers
BoxCollider2D.bounds not update properly. Frame delay exists 0 Answers
How can Editor Script change value in a Prefab instance ? 1 Answer
Project broke when Unity updated 1 Answer
update unity web player 2 Answers