Hi WME community!
I'm currently working on my first WME game and I'm facing to a problematic I'm not able to solve myself.
In my scene, there are floors and ladders. I'm able to change the actor animation for the ladder by creating for each ladder region the following dedicated script :
on "ActorEntry"
{
actor.WalkAnimName ="ladder";
}
on "ActorLeave"
{
actor.WalkAnimName ="walk";
}
It works fine, but as I'll have a lot of ladders, I was wondering if there is a way to add an event listener on ALL the regions, and to code the conditionnal logic inside. I have in mind to :
- Add a property "ladder" to every ladder regions (Custom > Properties)
- Create either way this "magic-global-region-event-listener" and use something like:
on "ActorEntry"
{
if (this.ladder != null){
actor.WalkAnimName ="ladder";
}
}
First of all, does it make sense to the WME profesionnal you are?
If yes, could you please help me to do it ?
Thanks a lot for your time !