This is the Code: The code is From unity networking Tutorials. Code (CSharp): using UnityEngine; using UnityEngine.Networking; public class PlayerController : NetworkBehaviour { public GameObject bulletPrefab; public Transform bulletSpawn; void Update() { if (!isLocalPlayer) { return; } var x = Input.GetAxis("Horizontal") * Time.deltaTime * 150.0f; var z = Input.GetAxis("Vertical") * Time.deltaTime * 3.0f; transform.Rotate(0, x, 0); transform.Translate(0, 0, z); if (Input.GetKeyDown(KeyCode.Space)) { Fire(); } } void Fire() { // Create the Bullet from the Bullet Prefab var bullet = (GameObject)Instantiate( bulletPrefab, bulletSpawn.position, bulletSpawn.rotation); // Add velocity to the bullet bullet.GetComponent<RigidBody>().velocity = bullet.transform.forward * 6; // Destroy the bullet after 2 seconds Destroy(bullet, 2.0f); } public override void OnStartLocalPlayer () { GetComponent<MeshRenderer>().material.color = Color.blue; } } Error:Assets/Scripts/PlayerController.cs(40,37): error CS0246: The type or namespace name `RigidBody' could not be found. Are you missing a using directive or an assembly reference?
I had the same error when trying simple script aswell. Code completion wouldn't even find Vector2. Close Visual Studio and reopen the script, it propably links the project right that time. At least for me it did.