Answered: Error with scripts when building Player
How do I fix this?
Assets/Scripts/ThirdPersonCamera.cs(24,7): error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing a using directive or an assembly reference?
and
Assets/Scripts/ThirdPersonCameraEditor.cs(3,7): error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing a using directive or an assembly reference?
Error building Player because scripts had compiler errors
The UnityEditor namespace isn't included in builds, which is causing the problem. You can move "ThirdPersonCameraEditor.cs" to a new folder called "Editor" (Unity arbitrarily excludes this folder from builds), and wrap the editor debug code in ThirdPersonCamera.cs in "#if UNITY_EDITOR" and "#endif" preprocessor statements to exclude them from builds. Specifically, at the beginning of ThirdPersonCamera.cs:
using UnityEngine;
using System.Collections;
#if UNITY_EDITOR
using UnityEditor;
#endif
and in the "Unity event functions" region:
#if UNITY_EDITOR
/// <summary>
/// Debugging information should be put here.
/// </summary>
void OnDrawGizmos ()
{
if (EditorApplication.isPlaying && !EditorApplication.isPaused)
{
DebugDraw.DrawDebugFrustum(viewFrustum);
}
}
#endif
Hope that helps you out!
Thank you! Working great now!
I've tryed all this and it does not work for me... :( pls help
changed the character mat and will be adding more ui and weapons to character that you will be able to switch out. COMMING SOON!!!