- Home /
I rendered my game and it crashes when I start it, how can I fix it?
In unity my game would work fine, it would have errors but they weren't fatal but when I rendered the game it would crash when I start it, any suggestions?
If a lot of things depend on that, then you should start by writing a clear and understandable question.
How are we supposed to help you if you don't provide any info?
"$$anonymous$$y game crashes, help." isn't enough.
Have you tried running the game in the editor? Have you checked the console for any error messages? Do you have any idea where a bug might be in your code, such as an infinite loop?
@nsxdavid is absolutely right. There is no way we can help you with so little information. How did it crash? Hang? Not dispaly? Other? Can you show is the script it is hanging in? See the tutorial video about asking questions on this list.
sorry I gave little info, It works in the editor of cause and yes I have checked for errors. there is errors in the game but it can still run in the editor, and works exactly how I want it... its only when I have rendered the game it crashes.
Do you have any red errors when you run it in the editor? What platform are you building for? How difficult is it to narrow down the problem (i.e. how many scripts do you have)? What have you done so far to figure out the problem?
Answer by robertbu · Mar 19, 2013 at 12:44 AM
You need to fix all the red errors, and it would not hurt to fix all others. It looks like either you've spelled the name of the tag incorrectly or have failed to define the tag 'waypoint'. Capitalization matters. Waypoint != waypoint != waypoints... So that means that when you do:
wayPoints = GameObject.FindGameObjectsWithTag("waypoint");
You are getting back a list with nothing in it. So when you do attempt to access with wayPoints[rand] you get more errors because are attempting to access information from an empty list. This type of error will typically run in the editor but will crash a device.
A couple of notes:
When you post error messages and the code, you need to double click on the error and then add a comment to the line that has the error. The line number in the listing below do not line up with the line numbers in the listing, and knowing what lines the errors occur on is a huge help in figure out what is going on.
By posting followup information as answers, your question is now marked as having two answers (though you've not received any answers yet). Having it marked as having two answers makes it far more likely that people answering questions will not look at your question. You can convert your answers below to comments using the 'more' drop-down at the bottom of each answer.
I could not send the script through as a comment because it was over 3000 characters
The original question can be larger than a comment. Edit the original question if you want to add a script later.
Your answer
Follow this Question
Related Questions
Stuck on splash screen android 0 Answers
Build Iphone Issue 0 Answers
Unity Editor silently crashes straight away no error logs 1 Answer
MonoDevelop Crashing On Startup with No Error Message 2 Answers
java.lang.Error running on Android 0 Answers