Enemies not rendering

I’ve been following along Rick’s lectures with the occasional error, but that’s been fixed (was most of the time a misspelling). However this time after spending a while relooking at the lectures and searching in unity and stack overflow I could find nothing to help. Whenever I click play my enemy game objects spawn but don’t seem to render into the camera. I’ve changed the depth of the background and camera but still doesn’t change. There is no error but simply my enemies don’t show. This didn’t happen until we unSerializeFielded the waveConfig in the enemyPathing. Would love to have some help :).

Hi Froggy,

Welcome to our community! :slight_smile:

Is the z-position of the camera set to z = -10, the background to z = 10, and the rest to z = 0?

Hello, thanks for welcoming me!

Such an easy fix, didn’t think about bringing it further back! Thank you so much!

You’re welcome. :slight_smile:


See also:

I have one more question: For some reason, whenever I click play while Path(0) is used then an ArgumentOutOfRangeException comes up in the console. I’m not sure why…

Check the length of your array and the index your code is trying to access. Use Debug.Log. The first two lines of your screenshots are indicating the problem.

I’m not quite sure what you mean, Path(1) works fine but Path(0) brings up the error. What does the index mean? Is that the SerializedFields?

Did you expose a waypoints array in your console? If not, how did you assign the Path game objects to the EnemySpawner component or the Enemy component?

YES! THANK YOU! I hadn’t made the waypoints into gameObjects so I made a new prefab of the path(0) and then reassigned it and voila! That was painfully long but we finally got there. Thanks so much for your help! :slight_smile:

Good job on solving the problem! :slight_smile:

Thank you :smiley: and thank you so much for your help!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms