Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Compiling Error

Discussion in 'Documentation' started by trandominhkhoi1, Feb 28, 2018.

  1. trandominhkhoi1


    Feb 22, 2018
    Hello, I am a coder who is new to this program. I made a script but when I try to plug it in and start the play mode, in the inspector column, it said "The associated script can not be loaded. Please fix any compile errors and assign a valid script my script:

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    namespace Moving {
    namespace UnityEngine.Networking{
    public class Behaviour : MonoBehaviour {
    public float speed;
    public Rigidbody rb;
    void Start ()
    rb = GetComponent<Rigidbody>();

    // Update is called once per frame
    void FixedUpdate () {
    float moveUp = Input.GetAxis ("Horizontal");
    float moveRight = Input.GetAxis ("Vertial");
    Vector3 Move = new Vector3 (moveUp, 0.0f, moveRight);

    rb.AddForce (Move * speed);