Gizmos not showing up

       void OnDrawGizmosSelected()
        {

            Gizmos.color = Color.red;
            Gizmos.DrawWireSphere(attackPos.position, attackRange);



        }

Gizmos not showing up.What is the problem with this code?

Start by checking the data: use Debug.Log() to print out the values in the arguments you are supplying to DrawWireSphere. This has the side benefit of telling you if this code is even being called or not!

They are all ok,but I noticed that I am having a error that is not even stopping the game.

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.Graphs.Edge.WakeUp () (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/Edge.cs:114)
UnityEditor.Graphs.Graph.DoWakeUpEdges (System.Collections.Generic.List1[T] inEdges, System.Collections.Generic.List1[T] ok, System.Collections.Generic.List`1[T] error, System.Boolean inEdgesUsedToBeValid) (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/Graph.cs:387)
UnityEditor.Graphs.Graph.WakeUpEdges (System.Boolean clearSlotEdges) (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/Graph.cs:286)

I couldn’t understand what is the problem.

The good news is, as soon as I typed the above error into google, I got this!

ALWAYS type the error into Google. You’re just NEVER going to be the first guy to see it. Never.

1 Like