Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2003
    Posts
    5

    Question Simple Character System - MissingComponentException CharacterController

    I have been working thought the Simple Character System videos, However ive got stuck and not sure where ive gone wrong or what I have missed.

    When I get to video 11 - Wiring and Testing, my character does not move using the wasd or arrow keys. I have added TP_Controller and TP_Motor to a Capsule (code added below) but get the following error message;

    "MissingComponentException: There is no 'CharacterController' attached to the "Capsule" game object, but a script is trying to access it."

    Im sure its something ive missed but can't find a solution. If someone could guide me to what I need to do or the video I should rewatch it would be great. Ive tried going back thought some of the videos but cant seem to find anything coving this.

    Thanks
    Softwebb

    - Code Removed - Following the comment below (sorry didnt think about that, thanks for the tip)
    Last edited by softwebb; 04-12-2011 at 01:21 PM.

  2. #2
    Join Date
    Apr 2009
    Location
    Rochester, MN
    Posts
    179
    "MissingComponentException: There is no 'CharacterController' attached to the "Capsule" game object, but a script is trying to access it."
    This is telling you the exact error your having. There is to component of type CharacterController attached to your Capsule object. You have to have on on the character (your Capsule) inorder for this to work.

    Check out this line in your code:
    CharacterController = GetComponent("CharacterController") as CharacterController;

    Here is where you are trying to get and use the component CharacterController. BTW this is located in the menu Component->Physics->Character Controller. Try adding one of those to your Capsule and see if that works! And I recommend not posting entire classes. This goes against what the 3dbuzz people are trying to do here, which is teach people how to do this stuff. If there is code posted enough people will just copy it.

  3. #3
    Join Date
    Nov 2003
    Posts
    5
    Yay thanks Seridaq. Thats just the thing I needed. New to this Unitity stuff but really enjoying it. Was this said in a video that I missed or we were expected to know about this ?

    I knew that was the problem just didnt know where I would find the Character Controller.

    Thanks again for the help, I owe you one. Now getting back to the next lot of videos !!

  4. #4
    Join Date
    Sep 2008
    Location
    Salisbury, UK
    Posts
    2,812
    Quote Originally Posted by softwebb View Post
    Was this said in a video that I missed or we were expected to know about this ?

    I knew that was the problem just didnt know where I would find the Character Controller.
    Sounds like you need to go through the Unity Fundamentals video series... All the basics are covered in those vids

    I found
    my current avatar on google, so props to THIS GUY who created the original...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •