Saturday, October 29, 2011

Working on an arcade style hack & slay game

I am currently working on a hack and slay with random generated dungeons in Unity3D. Target platforms are Unity3D webplayer and mobile devices.

My goal is to create a fast paced game with arcade elements, like double damage power ups, instant health pick ups, limited ranged ammo etc. The gameplay would be more like playing the classic Gauntlet than playing Diablo. I would like to implement a coop multiplayer mode too, but at the moment these are dreams of the future.

At the moment i have a playable prototype with dummy graphics and the first version of my dungeon generator working.

Right now i am working on my bestiarium - the game will have 3 enemy classes with a total of 8 different models featuring ranged and melee attacks with physical and magical damage. The modeling is nearly completed and i will post some wip shots soon.

Wednesday, October 26, 2011

Howto attach an object to a bone (Unity3D)

The basic principle of attaching any object to a bone of your animated model, is to make that objects transform a child of the bones transform. For example: parent the hand bones transform to the swords transform.

You could access the bones transform by script using
weapon.transform.parent = GameObject.Find(path to your bone).transform;

but this is quite unflexible. Instead take a look at the following script, which you could add as a seperate component to your animated model. (you can of course implement the code in your own classes too):

public var weapon:GameObject;
public var weaponBone:Transform;

function Start ()
{
 // instantiate the weapon prefab
 var weaponTransform:Transform = Instantiate(weapon, weaponBone.position, weaponBone.rotation) as Transform;

  // make the bone a parent of the weapon
 weaponTransform.parent = weaponBone;
}

Now you have to assign the bone of your animated model to the weaponBone variable. Find the bone in the Hierarchy panel and drag it to the variable slot in the Inspector. Attach the weapon by dragging your weapon Prefab to the weapon variable slot.

This way you can easily attach any object to any bone without hardcoding your armature structure.


Hint: You can only access a bone via the Hierarchy panel. If your model isn't already in your scene, you have to create a single instance, by dragging your animated model Prefab into the scene window. Find the bone in the Hierarchy and assign it to the variable slot. Click "Apply" in the Inspector panel to apply this change to your Prefab and remove the Instance from the scene.

Tuesday, October 25, 2011

"Once upon a time..

a man studied the secrets of game development, browsing through scrolls of knowledge and mindfully listening to the masterly. Now times have come that he forges his own games and spread his thoughts to other fellows."

Welcome to my blog! I will use this blog as a dev log for my indie projects and share tricks i found out while working on my games.