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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Beginner Question - Load a single standard asset in Unity 5, not every asset

Discussion in 'Editor & General Support' started by createasaurus, Sep 5, 2015.

  1. createasaurus

    createasaurus

    Joined:
    Sep 20, 2013
    Posts:
    9
    Hi,

    My goal is to load the 1st person character controller from the standard assets into my game. I do not want to load every standard asset, because I think it will make my file saving too heavy. However, when I uncheck the other assets on pre-load, it causes errors.

    Here is specifically what I've tried:

    I go to Asset store, Download, Standard Assets 1.0, then I click Import.
    It opens a checklist of components to import.
    I deselect all, then click 1st person character...

    So basically I only load the 1st person character controller. I immediately get this error:

    Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/FirstPersonController.cs(3,27): error CS0234: The type or namespace name `CrossPlatformInput' does not exist in the namespace `UnityStandardAssets'. Are you missing an assembly reference?

    I suspect there are more items I need to import... I've been experimenting / failing... but I do not have the experience to really understand what I am doing and know which additional components to import.

    I've tried also importing the entire character folder... but it still gives errors. I think I remember in Unity 4, being able to import a single item... and having it be self sufficient.

    Thank you for your thoughts.
     
    Last edited: Sep 5, 2015
  2. goonter

    goonter

    Joined:
    Aug 31, 2015
    Posts:
    89
    Try the whole first person character folder. Then any errors like the above, import the scripts one by one ( like for your example above, find CrossPlatformInput.cs and import it). Then keep finding scripts it identifies in the errors and import them one by one until your project compiles again.

    Also as a side note, it doesn't matter how many assets you have in your project in terms of your game build size. When you create a build, only assets that are referenced in a scene inside your build settings or in the Resources folder are included in the build. So you can have gigs and gigs of files in your project and they won't make your actual game build any bigger unless you are using them.
     
    CyberShot212 and bernardodesousa like this.
  3. createasaurus

    createasaurus

    Joined:
    Sep 20, 2013
    Posts:
    9
    Thank you goonter.

    One at a time I followed the errors and it now works!

    Good to know if I add extra stuff, it only counts to my project if actually used.

    Thanks again!!
     
  4. bernardodesousa

    bernardodesousa

    Joined:
    Feb 5, 2016
    Posts:
    1
    It's good to know that! Thank you, sir! :)
     
  5. iSamuelR

    iSamuelR

    Joined:
    Apr 21, 2017
    Posts:
    1
    Funciona perfectamente! :)