Create actor / script:
- Code: Select all
CreateActor("rabbit", "rabbit2_attack_right", "Creator Actor", "(none)", 0, 0, false);
Then I set second actor's creator as his parent.
The thing is, I'd like to change second actor's animation from first one's variables.
something like this:
- Code: Select all
switch(state)
{
case 0:
angle= direction(x, y, player.x, player.y);
directional_velocity=2;
switch(dir)
{
case 0:
ChangeAnimation("rabbit", "rabbit2_walk_left", NO_CHANGE);
break;
case 1:
ChangeAnimation("rabbit", "rabbit2_walk_right", NO_CHANGE);
break;
}
}
The script works perfectly But, Enemy actors are clones so I replaced the code this way:
- Code: Select all
ChangeAnimation("child", "rabbit2_walk_left", NO_CHANGE);
But now it does not work anymore. Does someone know what to do to have one enemy actor act on his own second actor?
Thanks in advance