x


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()); }

more ▼

asked Aug 20 '11 at 11:57 PM

haveheartt gravatar image

haveheartt
1 1 1 2

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.

Aug 21 '11 at 12:33 AM sharat

its my vitals function any advise?

Aug 21 '11 at 12:50 AM haveheartt

can u help me out with a proper vitals function for unity 3.4?

Aug 21 '11 at 01:03 AM haveheartt

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.

Aug 21 '11 at 01:33 AM sharat

i can post my playercharacter script mind taking a look see if something is wrong?

Aug 21 '11 at 01:36 AM haveheartt
(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x838
x10

asked: Aug 20 '11 at 11:57 PM

Seen: 688 times

Last Updated: Aug 21 '11 at 04:48 AM