playMaker

Author Topic: [Query] Animation event issue  (Read 404 times)

Aven

  • Playmaker Newbie
  • *
  • Posts: 2
[Query] Animation event issue
« on: March 25, 2023, 05:48:20 AM »
Hi Playmaker devs, I'm new to use this powerful asset. Now I'm making a 2D game as a practice.
So, currently I have 1 enemy and its attacking animation has 10 frames. The very frame that I want to add event is the 4th frame. So I add an event at 4th frame, and then use the Event Proxy Wizard to create a script called "AttackHitCheck". After this, I add the script to my enemy, set the FSM event as "Attack Hit Check" to get into the next state which is checking if a ray cast hits the player.
The function works just fine, however, the enemy attack animation will break off since the event is triggered at 4th frame. That is, my enemy attack animation will only play for 4 frames.

(See the gif below.)


How to make the enemy attack animation play completely, and still send an animation event at 4th frame?

Any info and suggestions would be appreciated!
« Last Edit: March 25, 2023, 11:02:03 PM by Aven »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: [Query] Animation event issue
« Reply #1 on: March 25, 2023, 10:59:36 AM »
Hi.

use the 'Direct Link'
Then click on the image button (above the text window on the left side)
and paste your link :
Code: [Select]
[img]https://i.imgur.com/QywjEql.png[/img]



Are you using animator for animation?
I can only see the state switching but not the actions are used.

Aven

  • Playmaker Newbie
  • *
  • Posts: 2
Re: [Query] Animation event issue
« Reply #2 on: March 25, 2023, 11:22:51 PM »
Hi.

use the 'Direct Link'
Then click on the image button (above the text window on the left side)
and paste your link :
Code: [Select]
[img]https://i.imgur.com/QywjEql.png[/img]



Are you using animator for animation?
I can only see the state switching but not the actions are used.

Hi, thanks for the tip inserting the image!

I actually add an "Animator Play" action in the attacking state. So when the 4th frame of the attack animation is played, it should trigger the event "Attack Hit Check" event, and then enter the state "Player Hit Check" with a ray cast 2D action, checking if the enemy hits the player.
If it's true, deals damage; if it's false, enter the reset state.
This is basically the logic of how an enemy attacks. Am I correct?

So the issue is, the animation after 4th frame will not be played properly when the ray cast 2D is true. :'(

Or, is there any other alternative way? I am willing to give it a try! Thank you.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: [Query] Animation event issue
« Reply #3 on: March 26, 2023, 05:09:31 AM »
Hi.
I would not use a raycast, its a single line.

use boxcast for example or overlap box

separate the damage part in a different fsm than the animation.