dot big bang

Developer API
Menu
All
  • Public
  • Public/Protected
  • All

Enemies in this example are spread throughout the game. They will detect players moving into a radius and then chase that player until they can attack them or the player moves too far away. Most of an enemy's behavior can be customized by adjusting properties in the scripts on them.

An enemy can be a simple voxel object or a more complex animated NPC. We have examples of both in the game. The bat on the first island is a voxel object that plays different animations depending on what it is doing, while the other enemies are NPC’s.

The scripts that you should look at when configuring an enemy are:

  • Combat - Enemy Behavior
    • Allows you to configure how the enemy behaves
  • Combat - Health
    • Allows you to configure hitpoints and respawn behavior
  • Drop Collectables When Killed
    • Makes the enemy drop items when they are killed

Some other scripts you may find useful on enemies are:

  • Combat - Melee Weapon
    • See the Weapons section to understand when you would add a weapon script directly to an enemy
  • Combat - Ranged Weapon
    • See the Weapons section to understand when you would add a weapon script directly to an enemy
  • Combat - Health Bar
    • Shows the player or enemy health above them
  • Flash When Damaged
    • Makes the player or enemy flash a color over a period of time when they take damage
  • Blob Shadow
    • Places a voxel object below the player or enemy and fades it out if they move into the air
  • Voxel Object Animation Controller
    • Only needed if the enemy is a voxel object and you want to play animations for attacks and movement
  • Voxel Object Animation
    • Used alongside the Voxel Object Animation Controller to define which frames go with each animation