Currently, we are using an Any State to display damage numbers when the enemy object takes damage.
Ideally, the behavior should be as in ①, but currently it behaves as in ②. If you have any suggestions or workarounds, please let us know.
Note: In the current state (②), the animation restarts from the beginning, and if we keep hitting the enemy, they stop attacking.
① Ideal Behavior
• Enemy enters attack animation
• Enemy is hit
• A damage number object is spawned in the Any State to display the damage
• Return to the previous state
★ Enemy resumes the attack animation from the “middle”
② Current Behavior
• Enemy enters attack animation
• Enemy is hit
• A damage number object is spawned in the Any State to display the damage
• Return to the previous state
★ Enemy resumes the attack animation from the “beginning”
Regarding the damage display, as you pointed out, I believe that executing it on a single object will interrupt the damage state even if AnyState is used.
Therefore, how about preparing a separate child object for generating the damage object and displaying the damage there?
I apologize if I’m misunderstanding, but currently, we are doing the following:
Hit an enemy → Transition to Any State on the enemy’s VS → Instantiate a child object for damage display above the enemy’s head → Destroy the child object after a certain period.
(The child object for damage display is prepared separately.)
Are you suggesting that we should instantiate the child object for damage display at some point without using Any State?
I’m sorry, but I’m having trouble connecting what I want to achieve with the answers provided.
What I want to do is:
“Attack the enemy during their attack animation
→ Display damage above the enemy’s head
→ Then resume the enemy’s attack animation from ‘mid-way’”
It’s similar to the super armor mechanic often seen in fighting games.
Is the idea that instead of checking the enemy object directly, we use the “HitCollision” of the “damage text generation game object” you mentioned to detect the hit?
→ Transition to Any State to display damage
→ Inherit the damage taken by the parent object?
① Ideal Scenario
• Enemy enters attack motion
• Attack connects with the enemy
• Jump to Any State, generate the damage text object, and display damage
• Return to the previous state
★ Resume the enemy’s attack motion from “mid-way”
Thank you! I finally understand!
However, based on what you’ve shown me, it seems like we’d need a dedicated object for each enemy type…
I wish there were a simpler way, but I’ll proceed with the method you’ve explained for now.
Thank you for your time and research.
Actually, you can do this in an AnyState: after the damage display finishes, draw a connection line from that action to the next action you want to execute. This way, once the action within the AnyState completes, you can control which action should follow.
If there are many types of enemy characters,
I think you could create a common setup by generating them as “child objects” and setting the variable target to the “parent object”.
In that case, you would also need to add ChildSettings to the damage label generation object.
Thank you.
I thought I would have to create a dedicated child object for each enemy object since entering an object path was required when specifying the parent object, but with patch 1.0.7, it can now also reference variables for “parent objects that are not the specified file path,” wasn’t it?
I was able to implement what I wanted to achieve by unifying the child objects just now.
Thank you very much.