Play animation when key pressed, while coliding wth object

M4st3rk33n

  • Posts: 6
I have a little issue

I want one of my actors to play a short animation when the up key is pressed, but only while in contat with another actor in my game (by that i mean only when their hitboxex collide).  Im new to stencyl. Can anyone tell me a way to do that?

LIBERADO

  • *
  • Posts: 2712
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

M4st3rk33n

  • Posts: 6
I tried that but it doesen't seem to work.  I attached the script to one actor at a time, then to both actors, and even tried to make it as a scene script. I know the collision is detected since if i replace the "switch animation" block with "kill actor" the actor A dies when it collides with actor B. I searched on google for a result but no luck.

LIBERADO

  • *
  • Posts: 2712
Please, post a screenshot of your code.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.


LIBERADO

  • *
  • Posts: 2712


Drag the "1st actor" tag and drop it over the "Self" word.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

M4st3rk33n

  • Posts: 6
Thanks  :)
 I have identified the problem. It was in another script that was constantly telling the actor to switch to the iddle animation on every update. i fixed that by disabling that script while the animation is playing. I feel so stupid for not noticing this lol sry for wasting ur time. but putting the "1st actor" over the "self" label seem to contribute too.