K te chuzi…
Do scriptu prirazeneho k actoru prihodis script:
on "footstep"
{
// get a region the actor is standing in
var Reg = Scene.GetRegionAt(this.X, this.Y);
if (Reg!=null)
{
// play a sound depenging on a surface
// "xSurface" is a custom property we defined in SceneEdit
switch(Reg.xSurface)
{
case "beton":
this.PlaySound("sound/betonstep.wav");
break;
case "trava":
this.PlaySound("sound/travastep.wav");
break;
}
}
}
pak ve scene editoru konkretni prostory oznacis jako regiony a v custom pak zadas:
name: xSurface
value: beton
a další region:
name: xSurface
value: trava
Pokud chces pouzit pro jeden typ povrchu vice zvuku naslapnuti, aby každý krok neznel stejne, vytvor tri rozdilne zvuky chuze, za nazev dosad cislice 1 az 3 (napr. betonstep1.wav) a pak pouzij ve skriptu:
this.PlaySound("sound\betonstep" + Random(1, 3) + ".wav");