Refering to Child of Gameobject while it doesn't exist yet.

Hi,

So I’ve combined the smartfoxserver script with the charactergenerator so far and it’s working fine. Just that the localplayer and remoteplayer prefab don’t have an animation directly tied to them because the model gets generated, loaded in later and then attached to the game object.

At that point the Gameobject Localplayer Remoteplayer have a ‘child’ which is the model which has an Animation property.

The script used to trigger the animations by animation.crossfade(‘’) but since the model is under the gameobject (a layer deeper) i’m wondering how i can reach it.

something like male.animation.crossfade(‘’); hasn’t been succesfull thusfar.

So i’m really just wondering how to tell a script it should look for the child of the object and then for the animation property, any ideas?!

Greetings,

Gerard

I’m playing around with this as well.

So far I’ve just played with getting the local player working.

Basically I created a new local player, modified it with a new character controller script called Avatar, which does the character generation in Start(). Update() takes care of the movement control/animations, which you can now access directly as character.animation.Play(“walk”) for example.

So the structure is:

Local Player (with scripts)
Particle System
Main Camera

Seems to work ok, needs more work.