After Building and Run the game act different.

Started by
3 comments, last by Box.Csapp 3 years, 8 months ago

Hello, i am very new in programming, so from a lot of things, i am very confused of course, but most of them i am able to sort out by google out, but here I really don’t know. - C#

So, i somehow make my first game ever, try Build a game and when i did it, the game just start acting little bit weird. I just asking, if it’s coz i wrote it in so bad way/chaotic/newbie way, or what....

I maked Tower Defense, in this moment its only spawner, which spawning infity of waves of enemies and a lot of places, where i can build my towers. When enemy is spawned, it find the way, where to go (empty gameobjects), by find GameObjects and add them in array.

The problem is, in editor work everything absolutely okey, no errors nothing.
When i build the game, the enemies go instead of over 12waypoints over 2 and taking players life straight away.

Can just somebody tell me the logic of it, i mean, why it work in editor and out doesnt?
What keyword to looking for on google to learn this thing? Its some type of Architecture or something?

Thanks for help and sorry for my bad english, i just start do programming like month ago and this make me little bit sad.

Advertisement

If it doesn't work as expected everywhere you made an error. The fact that doesn't happen in the editor doesn't mean much, maybe it fails but you missed it, or it works by luck (or bad luck, depending how you see it). Maybe the editor itself has bugs that hide your bug, who knows.

The biggest problem however is that you can make a zillion different errors. That means that based on your generic description it is clear that “something” is wrong, but what exactly is causing it cannot be deduced from it. It would help if you post the code (or store it at a site like github and point to it), so readers here can have a look. (I have never programmed Unity or C#, so I wouldn't get very far, but lots of people here have experience in that language.)

Programming does work like this though, it has high mountains of joy but also deep dark valleys with seemingly no exit. We do make mistakes at time, and computers are extremely good at breaking down at them. Don't be sad, better times will come again, and in time, you will find out how to cope with these things.

If it is a timing issue you might probably not have used a delat to determine the different timing intervals between your frames and your enemies are just “running” too fast. Time.deltaTime does the trick or use a FixedUpdate instead of an Update

@Semtex Do you use a timer to control the amount that appears? or Do your enemies have the same speed?

This topic is closed to new replies.

Advertisement