- Home /
unity 3.4 crashes when i get to a certain point in the character generator script?
ok so debugged everything no errors unity still crashes cuz of my vitals part in my character generator script any ideas?
private void DisplayVital(){ for(int cnt = 0; cnt < Enum.GetValues(typeof(VitalName)).Length; cnt++){ GUI.Label(new Rect(10, 40 + ((cnt + 7) 25), 100, 25), ((VitalName)cnt).ToString()); GUI.Label(new Rect(115, 40 + ((cnt + 7) 25), 30, 25), _toon.GetVital(cnt).AdjustedBaseValue.ToString()); }
You can probably narrow it down to one of those 5 functions called in OnGUI() by commenting out those lines and see which ones can cause a crash by themselves.
can u help me out with a proper vitals function for unity 3.4?
Hmm, I don't see anything wrong with the GUI part of that code. I don't know anything about your implementation of the PlayerCharacter class, so I'm guessing it would be somewhere in there? I guess there could also be a problem with the enum VitalName, but I imagine the compiler would complain about that first. I'd double check that it is defined somewhere just to be safe though.
BTW, you can format the code by pressing the 101010 button, that will make it a bit easier to read. You should just highlight it and press the button.
i can post my playercharacter script $$anonymous$$d taking a look see if something is wrong?
Your answer
![](https://koobas.hobune.stream/wayback/20220612185145im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
why when i try to add my script to the "player" it says can not can not add script 1 Answer
Am I miss using: application.loadlevel(x); 2 Answers
How to create a UnityScript array and access the data in each cell. 1 Answer
Cloud recognition in Vuforia 0 Answers
Supposed movementspeed extremly low 1 Answer