dot big bang

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

This kit has many examples of destructible objects. The main two scripts required to make an object destructible are "FPS - Damageable" and "FPS - Destructible". There are also some other scripts that can be used to alter or enhance the destruction.

FPS Destructibles

Just like pickups you can configure these and drag them around your maps. By default a destroyed object will not reappear until the round is over. If you want objects to periodically respawn after being destroyed you can use the barrel and target destructibles as a starting point. These destructibles are spawned in by an object with some additional settings.

Some interesting scripts and settings to look at are:

FPS - Destructible

Has Gravity

  • Stacking these destructibles will create a pile or tower that will fall downward when one is destroyed.

Delay Seconds

  • This will give the destructible time before it dies to show some effects. Flash During Delay will make the object flash if it also has a "FPS - Flash Color" script on it. Scale By will cause the object to scale or swell up before it is destroyed. This can look great when combined with some explosive visual effects.

FPS - Set Frame Based On Health

This script will cause one or more Voxel Objects to move to an animation frame based on the percentage of health the object has left. This can be used to show damage happening to an object over time, with effects like cracks or dents appearing.

Voxel Object Component Numbers

  • This can be used to target specific Voxel Object Components if you only want to apply this effect to some.

Affect All Voxel Objects

  • Checking this will move all Voxel Object Component frames based on damage.

FPS - Spawn Object On Destroy

This script lets you spawn an object when the one with the script on it is destroyed. This is great for dropping a pickup, or some other item.

Template

  • This is the object that gets spawned. If the destructible object is networked then this object will inherit that.

Offset

  • This can be used to shift where the template gets spawned. It is in the local space of the object so it will take rotation into account.

FPS - Object Spawner

This can spawn anything, but in the kit it is being used to spawn destructibles like barrels and targets. It can respawn destroyed objects during the round and it can also be set up to only spawn objects when specific player counts are met. This is used to provide single players with something to do while waiting for opponents in this kit.

Template This object will be spawned. If the object itself is a Destructible it should not be set to respawn itself.

Vfx This template will be spawned when the Template is spawned. It should destroy itself when it is done using a dbb_destroy_after_delay script or similar.

Offset This can be used to position the spawned templates. It will respect the rotation of the spawner.

Respawn If Destroyed If true, the Template will be respawned after Respawn Seconds has passed.

Respawn On Round Change Determines when to respawn objects based on the round state.

Respawn Seconds The number of seconds to wait before respawning the Template if Respawn If Destroyed is true.

Min Players Required To Spawn Will only spawn the Template if at least this many players are in the game.

Max Players Required To Spawn Will only spawn the Template if the number of players in the game is at or below this value.