Instances and Animations

Get help using Construct 2

Post » Tue Apr 10, 2012 7:51 am

Hi all,

I have an enemy (hungry teddy bear) that patrols back and forth. His arms are their own animation because they do an attack animation when the player gets close. Otherwise, they stick straight out like a zombie (default animation).

The animations work fine when I have one bear - all the not mirrored/mirrored stuff works, the arms face the way the bear is facing/moving, etc.

However, when I have multiple instances of the bear throughout the game, the arms flip back and forth randomly on all the instances.

Does anyone know how I would fix this or if there's a solution online I can check out?

Thanks!!
B
4
Posts: 5
Reputation: 310

Post » Tue Apr 10, 2012 10:09 am

Without seeing your .capx it's hard to say anything. If those arms are separate instances and if you are using that mirror command in your "code" for all the bears without getting their ID's it will apply to all of them.
B
40
S
5
G
5
Posts: 405
Reputation: 5,657

Post » Thu Apr 12, 2012 5:59 am

Unfortunately I can't post it as this game is not just my own.

So, I need to get their IDs to be able to get this to work right? Should I be creating an ID instance variable and giving each bear it's own ID number? Or use UID or IID?

I think the arms are flipping because some bears are facing one way, while others are facing the other way (depending on which way they are patrolling at the time), and it's conflicting. I don't have this problem with one bear.
B
4
Posts: 5
Reputation: 310


Return to How do I....?

Who is online

Users browsing this forum: h1k3, Unconnected and 0 guests