Importing
Import Errors
If you receive any errors upon import it is likely because of a namespace conflict. Lets say that you have an existing project and in that project you have a class named Health:
using UnityEngine; public class Health : MonoBehaviour { /// <summary> /// Damages the object. /// </summary> public void Damage() { // My implementation. } }
If you have this class in your project and import the Ultimate Character Controller you’ll receive errors similar to:
Assets/Opsive/UltimateCharacterController/Demo/Scripts/DamageZone.cs(68,22): error CS1501: No overload for method `Damage’ takes `4′ arguments
The reason this error exists is because the original Health component in your project is corrupting the global namespace and the compiler which doesn’t know which Health component to use. The fix for this is to ensure all classes are in a namespace. You can fix this error by adding my original Health component to its own namespace:
using UnityEngine; namespace MyProject { public class Health : MonoBehaviour { /// <summary> /// Damages the object. /// </summary> public void Damage() { // My implementation. } } }
Sample Scene
The Ultimate Character Controller is stored within the Packages folder and the sample scene is a separate import. You can import the sample scene from the Tools -> Opsive -> Ultimate Character Controller -> Setup Manager -> Sample -> Import Sample menu option.
The sample scene has the following requirements:
- Uses TextMesh Pro. This can be imported from the Package Manager.
- Uses the Universal Render Pipeline. The Universal Render Pipeline is automatically set in Unity 6 and beyond, or can be imported from the Package Manager. The demo scene requires version 14.0.11 or later.
- The Universal Render Pipeline integration. This is automatically imported when you select Import Sample from above or can be imported from the Project tab:
- The DemoUniversalRenderPipelineAsset is set within the Graphics Project Settings or Quality Project Settings:
Graphics Settings (Pre-Unity 6):
Quality Settings (Unity 6):
After these requirements have been met the sample scene can be opened.
Assembly Definitions
The Ultimate Character Controller uses its own Assembly Definition files to decrease overall project compilation time. If you’d like to access an Ultimate Character Controller object through scripting ensure you have first added the Opsive.UltimateCharacterController Assembly Definition to your own Assembly Definition file.
Animation Import Warnings
When you import the Ultimate Character Controller into a fresh project you should receive no errors but there will be some warnings related to the animations, such as:
File ‘AimWalkFwd’ has animation import warnings. See Import Messages in Animation Import Settings for more details.
The reason this warning exists is because the animations were authored in Blender and Unity doesn’t like the way Blender exported the animation. Unfortunately there’s not a way around this but this is a one time warning and does not affect the animations when they are playing.