Unity Error: Toolkit Warnings

Lately I’ve been getting these warnings in Unity3D v3.4. I looked into it, and it’s safe to ignore for now. Here’s some info about it:

Warning:

warning CS0618: `UnityEditor.EditorGUILayout.ObjectField(string, UnityEngine.Object, System.Type, params UnityEngine.GUILayoutOption[])’ is obsolete: `Check the docs for the usage of the new parameter ‘allowSceneObjects’.’

Explanation:
Parts of the code used in the toolkit were updated from an earlier version. They can be safely ignored and will probably be updated soon.

[Source]

Advertisements

BurgZergArcade Progress: Code Demo posted

"Cowboy Game" Demo 1.2

I’m using the Protopack from Frogames for my animations, since it comes with enough assets (hopefully) to get this demo up and running. It cost ~$20 from the Unity Store, but it does seem to be very nice and enough to basically get me started here. I could have made my own models but I don’t have much time left (1 week) before classes start again, so this was a good alternative.

If you use Protopack 1.3, you’ll notice that some of the animations don’t work for the upper part of the body, such as “idle”, “walk”, etc. Those are designed to be used while holding a weapon, so they are waist down animations. If you want waist-up, you have to use up_* animations, such as up_idle.

Unity3d: Adding Mesh Collision

How to add Mesh Collision in Unity 3d:

In your prefab, go to Component -> Physics -> Mesh Collider.

Shouldn’t need to change anything.

Unity Error: Argument is out of range. (Tut57-59)

During tutorial 57, if you hit tab after generating the spawn points for the Slugs, you will get an error. I looked for a way to fix it for a while, but it was covered in tutorial 58 (unknown to me at the time).

Error:
ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index

Read the rest of this entry »

Unity Error: ListenerException

ListenerException: Attempting to remove listener for type player health updated but Messenger doesn't know about this event type.

Explanation:
Messenger is trying to remove a listener, but it doesn’t recognize the one you passed it. This means that either it wasn’t told about the listener that you are sending it, or you have a typo.

Non-programming explanation:
You have a package at UPS with the tracking number #1000000 (your Listener) and you want to pick it up from UPS (Messenger). You go to the UPS store and tell them the tracking number is #1888888 by accident, but they cannot find your package, so they keep your real package in the back (your Listener is not removed).

Example:
Messenger.AddListener("status", OnChange);
Messenger.RemoveListener("statussss", OnChange);

Solution:
Read the rest of this entry »

Programming Error: Cannot implicitly convert type `float’ to `int’.

error CS0266: Cannot implicitly convert type `float' to `int'. An explicit conversion exists (are you missing a cast?)

Explanation:
This often happens when ints are used in an equation that would yield a non-int, such as a decimal (float). In the example, 100/3 is 33.33333, which is being stored in an int. An int cannot store decimals, you need a float or double for that.

Example:
int var = 100/3;

Solution:
Read the rest of this entry »

Commentary: HnS #29 Saving Character Data

On the Unity documentation page for PlayerPrefs it says:

PlayerPrefs are stored in the registry under HKCU\Software\[company name]\[product name] key

This is in your registry. So on Windows 7, go to Start -> Type regedit.
Read the rest of this entry »

HnS #21: Commentary

In Unity HnS Tutorial #21 from BurgZergArcade.com, you might run into some errors like this:

NullReferenceException: Object reference not set to an instance of an object
CharcterGenerator.Start () (at Assets\Basic scirpts\PlayerScripts\Charcter Class\CharcterGenerator.cs:35)

Here’s what I did to fix it.
Read the rest of this entry »