Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Receiving Error Message for Character Controller

Discussion in 'Scripting' started by sumorocker, Feb 15, 2015.

  1. sumorocker

    sumorocker

    Joined:
    Feb 15, 2015
    Posts:
    1
    Assets/Movement.cs(21,20): error CS1061: Type `UnityEngine.CharacterController' does not contain a definition for `Simplemove' and no extension method `Simplemove' of type `UnityEngine.CharacterController' could be found (are you missing a using directive or an assembly reference?)

    This is the error Im receiving and here is my code, Im a beginner and have followed a youtube tutorial step by step and made sure that there were no spelling mistakes or punctuations in the wrong area. Let me know if you're able to help and it would be extremely helpful! Thanks for your time


    usingUnityEngine;
    usingSystem.Collections;

    publicclassFirstPersonController : MonoBehaviour {

    //Usethisforinitialization
    voidStart () {

    }

    //Updateiscalledonceperframe
    voidUpdate () {
    //Rotation

    floatforwardSpeed = Input.GetAxis("Vertical");

    Vector3speed = newVector3 (0, 0, forwardSpeed);

    CharacterControllercc = GetComponent<CharacterController> ();

    cc.Simplemove( speed );
    }

    }
     
  2. Jmanpie

    Jmanpie

    Joined:
    Oct 7, 2012
    Posts:
    132
    you should post code using the inset button so we can read it properly .

    The Function SimpleMove within the character controler class is actualy defiend as SimpleMove().

    Change your cc.Simplemove too cc.SimpleMove you have to use the exact case they use such as capitals when accessing functions or variables because they are unique identifiers.
     
  3. Nubz

    Nubz

    Joined:
    Sep 22, 2012
    Posts:
    553
    That entire script is a mess go smack the person that told you to write it like that.

    Not sure what this is even supposed to do.

    You or the person that did the tutorial needs to visit the learn section.

    Not trying to be mean just saying it's there.
     
  4. hpjohn

    hpjohn

    Joined:
    Aug 14, 2012
    Posts:
    2,190
    Yeah, how you can ctrl+C/V code and selectively lose certain spaces, i have no idea
     
  5. Nubz

    Nubz

    Joined:
    Sep 22, 2012
    Posts:
    553
    Isn't the GetComponent in Update the best part?