How to create an attack ability using TPC

Joan Sabé

New member
Hi,
I'm creating a third-person game with a quadruped character, using Playmaker (without writing code). I would like to add an attack option for the player, but I'm not sure how to do it. I've tried doing it through the Animator, but I'm not sure how to proceed. I have created a sub-state machine specifically for the attack and added the attack ability, but I don't know how to activate it.
Thank you for your help.
 
You can use the Use ability for an attack, and then add the animation states to the animator. You do not need to use Playmaker for this. Take a look at this video for how the animator is setup:

 
Hello, I have watched the tutorial, but I can't seem to create a melee attack for my quadruped.

Firstly, I must mention that when I initially created my generic quadruped, in the Character Manager > Advanced settings, I did not select "Items." My initial idea was not to have it capable of attacking or anything. In reality, I only want my quadruped to perform a melee attack, without weapons, only with his body. The animation is already done, but I don't know how to set it up through the animator to perform the melee attack.

In the Demo, the player has the value "21" set for the "Slot 0 Item ID" for melee combat. My player has the value "0". I'm not sure if this is why it's not working. I also wouldn't know how to change the value.

Interestingly, in the TPC demo, when I press the mouse button, it performs a melee attack, but in my quadruped, when I press the mouse button, it does nothing.

What can I do?

Thank you.
 
Last edited:
Hello,
I don't know what you mean by whether my 'Character Item' Animator Slot ID is correct or not. Where do I find the Character Item, and how do I know if it's correct? I see that in the Opsive Demo, they use 'Slot0ItemID' number '21' for melee combat. My player has the number '0'. If I manually change it to the number 21 through 'animator<parameters<Slot0ItemID<21', nothing changes. What could I do? I don't understand how to configure the attack, and I don't comprehend it in the video tutorial that Justin sent me either.
Thanks
 
From the controller side of things a generic attack is the same as a humanoid attack. The only difference is that you cannot retarget animations so you have to set that side of things up yourself.

Have you watched the melee setup video? That will give you a better idea of what the ItemID is used for. I recommend going through that with a humanoid character so you understand the workflow. Generic characters would then be the same, except you will need to setup the animator controller.
 
Top