Skip to main content

141. Unity3d Tutorial - Weapon Meshes Part 2

See video

We continue with another tutorial in our Hack And Slash demo made with the Unity3d Game Engine.

In this video tutorial, we will finish off the mesh swapping so the proper mesh shows for the weapon we currently have equiped.

Tags:

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Offline
Joined: Jun 12 2011

Hi,

I get the following warning:
Assets/Scripts/Character Classes/PlayerCharacter.cs(65,10): warning CS0108: `PlayerCharacter.Awake()' hides inherited member `BaseCharacter.Awake()'. Use the new keyword if hiding was intended

When I commented out the Awake in PlayerCharacter.cs, I get no error.

When I uncomment the Awake in PlayerCharacter.cs, I get the following error:
NullReferenceException: Object reference not set to an instance of an object
BaseCharacter.GetPrimaryAttribute (Int32 index) (at Assets/Scripts/Character Classes/BaseCharacter.cs:89)
GameSettings.LoadCharacterData () (at Assets/Scripts/Game/GameSettings.cs:62)
GameMaster.LoadCharacter () (at Assets/Scripts/Game/GameMaster.cs:54)
GameMaster.Start () (at Assets/Scripts/Game/GameMaster.cs:41)

Double clicking the error leads to the return line in:
public Attribute GetPrimaryAttribute(int index)
{
return _primaryAttribute[index];
}

I'm guessing you can't have an Awake in both BaseCharacter and PlayerCharacter. What about inheritance (override)? However I see no error in your video's.

Maybe it's me, but I don't see anything wrong in my code.

Does anyone else have this problem?

Offline
Joined: Jun 12 2011

I now see that this issue is solved in 143.

Offline
Joined: Jun 12 2011

even better at the end of video 147