Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: hoyoyo80 on October 10, 2018, 04:29:45 AM
-
Hi all,
Im working on health deduction. Ive set when player attack action hit an enemies,it will deduct one life(using Integer)
But when ive set the deduct event to finished and move to non deductive event, that one hit deduct a few numbers.
How to deduct once per hit?
Thanks
-
Hi.
It is very depending on your setup so if you could show some images or video from your setup :)
A possibility is that you will need to use a next frame event. somewhere in between
-
Hi all,
Im working on health deduction. Ive set when player attack action hit an enemies,it will deduct one life(using Integer)
But when ive set the deduct event to finished and move to non deductive event, that one hit deduct a few numbers.
How to deduct once per hit?
Thanks
Could it be that the event is triggered multiple times? To find out, you can switch on the counter how often states where triggered (I think that‘s in preferenes, or in the debug mode). Another pitfall is that the formula values aren‘t nulled and refreshed each new run, i.e. you accidentially operate with values left over from previous runs, and they add up.
-
Ive tried but still i deduct a lot instead of once
The process:
1.My sword hit box(a trigger) check the enemy hit(CheckHit)
2.If it triggered by the enemy, it will send a Global Event to the enemy to deduct its lives.(Send Hit)
3.The enemy received the global event and deduct 1 from its lives(GetHit)
Thanks
-
Hi.
You can remove the next frame events
You can try to set on trigger enter instead of on trigger stay.
Have a ontrigger exit in the loop.
Your setup now will trigger multiple times
As long it is inside the collider. :)
-
Thanks!!!
That quite a simple fix but i dont know it. Working perfect now!!!
Thanks again!!!
-
Hi all...
In other topic im asking about deducting health. But now my prefabs is ready to get hit and die. But i found that when i use more that one prefabs, the deducting sometime work and sometimes dont.
What could be the problem.
Thanks
Can you show the fsm on the prefab?
Are you using global variables?
How are you applying damage to the enemies?