Skip to content

Classes

Arnaud BM edited this page Mar 31, 2022 · 26 revisions

Character

Purpose

Character is the parent class of Player and Enemy, so all the variables and methods it has can also be used by their children

This class is not mean to be instantiated and shouldn’t be modified by any mean, you should only use Player and Enemy.

Variables

  • Max Health (Float) : The maximum health the character has

  • Speed (Float) : The movement speed of the character

  • Debug (Bool) : Allow you to see the hitboxes of abilities

  • Abilities (Array of Ability) : they’re the abilities the character will be able to use in play mode, to see how to define an ability, check Ability

Player

Purpose

The Player Character will be the character controlled by the player, you need to have only one player character in the scene, adding more is useless and can bring bugs.

If you want to created several type of player character with different abilities for example, you can "Right Click", "create a new "BLueprint Class" and look for "BP_Player". You can do this as many player character as you want

Variables

No particular variable

Enemy

Purpose

The Enemy Character will be a character controlled by a simple AI, You can have as many enemy as you want in the scene, they will always focus the player once it enters their aggro range.

If you want to created several type of player character with different abilities for example, you can "Right Click", "create a new "BLueprint Class" and look for "BP_Enemy". You can do this as many enemies as you want

The AI gets the ability it can use when the player is on range to hit him and according to this list, it launch a random attack.

Variables

  • Aggro Range (Float) : The range the enemy will start following and attaking the player, you can see it when you focus the enemy in edit mode

Ability

Purpose

Abilities are attacks the player and enemies will be using, they can be created by creating a children of the bluprint class "Abiliy".

Variables

  • Global :

    • Damage (Float) : The base damage the ability is dealing if it hits its target

    • Range (Float) : The range of the ability

    • Radius (Float) : The witdh of the ability

    • Forward Offset (Float) : The offset on the attack hitbox at the start of it

    • Cooldown (Float) : The time you have to wait until you can launch the ability again

    • Ready (Bool) : The state of hte ability, if it can be launched or not

    • Image (Texture 2D) : The icon displayed on the UI in game (Useless for enemies).

    • VFX (Niagara System) : Play the referenced VFX

    • Scale VFX (Vector) : Define the scale of the VFX

    • SFX (Sound Cue) : Play the referenced sound

    • Animation (Anim Sequence) : The animation played when the ability is launched ⚠️ The animation has to have a Hit Trigger and a Reset State, check Ability Animation ⚠️

  • Ranged Attack :

    • Is Ranged Attack (Bool) : The attack’ll be launched at cursor position or at Max Range

    • Max Range (Float) : The maximum range the ability canbe launched

  • Hold Attack :

    • Is Hold Attack (bool) : The attack’ll be charged and then used once the key is release

    • Max Time (Float) : Time needed to get the maximum damage output of the attack

    • Multiplier (Float) : Damage multiplier once max time is reached

    • Attack Animation (Anim Sequence) : The actual animation played when the ability is launched ⚠️ Animation should be the charging animation ⚠️

    • Time Launched (Float) : Don’t affect the attack’s behavior, this varibale can be ignored

Ability Animation

The animation you want to trigger when launching your ability has to have a "Hit trigger" and a "Reset State", they’re Animation Notify,

Hit Trigger

Hit trigger is an event that trigger the hitbox of the ability, so that its enabled at a precise frame and not at the beginning, you can add it to your Amin Sequence :

  • Open your animation

  • Right Click on the notify bar

  • Select "Add Notify" and "AN_HitTrigger"

  • Place it where you want the attack to hit the enemies

Reset State

Reset State is an event that reset the state of your character so he can act again, you can add it to your Amin Sequence :

  • Open your animation

  • Right Click on the notify bar

  • Select "Add Notify" and "AN_ResetState"

  • Place it when you want the animation to be cancelable by another one

Video example of how to implement :

Video
Clone this wiki locally