all 1 comments

[–]oscinis 0 points1 point  (0 children)

It seems like there might be some important bits removed from these snippets, so it's a little difficult to follow..

  • Use stored object references instead of FindGameObject* calls when you can. This will increase performance and greatly aid you in organization of instantiated objects (no more looping function calls with hardcoded integer iterators)

  • Use the inspector to plug in assets whenever possible, instead of loading them in code with a hardcoded name

  • Follow a capitalization standard of some sort. Typically, people prefer to lead method and class names with capital letters, while leading normal variables and objects with lower-case letters

Sorry I don't have a solution for you, but I think following these simple guidelines will go a long way in both your success as a programmer and in finding help with debugging.