I'm still having trouble with the scene view not showing objects

I’m using unity 5.6.3p2 personal and had trouble in a previous lecture getting the scene view to show the Enemy Formation box and now in this video it would not show the enemy when I drug it in to the scene. It shows in the game view and everything else shows in the scene view ok. I’ll write it off to qwerky as I was able to complete the lecture project.


I use the latest Unity 5 version and for me everything works fine. Sometimes I encounter an issue where the background, game object and camera’s z-axis are not set up properly. To correct this, I usually set the camera to -10, the background to 10 and everything else to 0. In addition you should not zoom in too much in the scene view, because then some game objects disappear (probably because your zoom level (z-axis) is >= 0 then)

I was able to verify the camera is set to -10 and the Enemy Formation and enemy is set to zero. Here are some screen shots so you don’t think I’m crazy… -tease… in the third picture I put the enemy prefab next to the player so you can see there is a player and no enemy graphic.

1 Like

Can you select the enemy prefab and provide another screenshot, this time with the full details of the Inspector - ideally without the keyboard over the top.

Actually, ignore that, can you zip up the project files and share it? If it is less than 10mb you can upload it within your post, if it is larger, please use Google Drive or Dropbox (or similar) and share the URL. Happy to take a look.

What a great idea! Thanks! It was 1.5 meg zipped. Here is the link
It will be interesting to find out if you can see it on your system.zip file

I downloaded your project and I can see the enemies in the scene view. This is just an idea, but could you check that the enemies layer is visible, in the top right Layers menu?

Edit: I figured out why the enemy formation box isn’t showing though, you simply forgot the ‘s’ in the call

public void OnDrawGizmos ()

in the FormationController script.

1 Like

I added an s, clicked saved, switched back to unity but the box did not appear.

And did you check that the Enemies layer is visible? Because the EnemyFormation game object also belongs to that layer, so if it is hidden, the box will not be shown.


Assuming there are no compilation errors preventing your code change from being recognised, you could also check that it is enabled under the Gizmos button also;


(screenshot for illustrative purposes only)

Yes everything in the gizmo dropdown is checked but there is not anything in there specifically about Enemies or EnemyFormation to check or uncheck.


So, nothing looking like this?


If this is the case, could you provide a link to an up-to-date version of your project files again, assuming the above link is no longer current. I am happy to take a look.

Updated Wed Nov 01 2017 22:04


I grabbed the project files from above, and once I had added the “s” to the end of “OnDrawGizmos”, as per @Sebastian_Martens reply above, the wireframe did appear in the scene, all I had to do was save the file in the editor I was using and click back into Unity;

public void OnDrawGizmos()
    Gizmos.DrawWireCube(transform.position, new Vector3(width,height));

It might be worth checking that your changes are definitely saved and that there are no other script errors which may be preventing a build of this change. I can confirm that your zipped project files above though do work with this one change. :slight_smile:

Here is a screenshot showing the two scripts which are calling the OnDrawGizmos method from your project files;


Yes I saw those two scripts in the gizmo drop down list and both were checked. Perhaps the box is not showing up in the scene view because the object name in the list is enemyformation and the script is called formationcontroller?

Script file names and class names need to be the same in Unity, but it doesn’t matter if the game object has a different name.

Privacy & Terms