ProjectileBlueprint2D
Inherits: Resource < RefCounted < Object
Class representing the model and desing of a Projectile2D.
Description
Projectile Blueprints are custom Godot Resources, and like Textures and Materials they only serve as data containers. Projectile Blueprints are used by the AP engine to create the real-time Projectile Objects.
Note: Do not change the ProjectileBlueprint2D at run time, these serve strictly as static data. Any changes you want to make at runtime must be made to the Projectile2D themselves through the Callables passed in the ProjectileCaller2D request_projectile method.
Properties
float | after_hit_angular_speed | 0 |
bool | allow_rehit | false |
float | angular_speed | 0 |
float | angular_spread | 0 |
bool | area_monitoreable | true |
float | cast_radius | 200 |
int | collision_layer | 0 |
int | collision_mask | 0 |
String | collision_path | "Collision" |
int | damage | 1 |
PackedScene | instance | |
int | instances | 1 |
float | lifetime | 1.0 |
float | linear_deviation | 0 |
float | linear_speed | 1000 |
bool | lock_to_target | false |
bool | look_at | true |
ProjectileBlueprint2D | on_expired_projectile | |
String | on_hit_call | "damage" |
int | pierce | 1 |
ProjectileDirectionality | proj_directionality | 2 |
ProjectileSpread | proj_spread | 0 |
ProjectileType | proj_type | 0 |
int | radius | 50 |
bool | randomize_positions | false |
float | rehit_cooldown | 0.1 |
int | seeking_mask | 0 |
bool | seeking | false |
float | size | 1.0 |
Texture2D | texture | null |
float | vertical_spread | 0 |
Enumerations
enum ProjectileDirectionality:
ProjectileDirectionality STRICT = 0
ProjectileDirectionality ADAPTATIVE = 1
ProjectileDirectionality MODIFIABLE = 2
The projectile will head towards its destination "x" value.
The projectile will head towards its destination "x" value and will change its position to its destination "y" value.
The projectile will head towards its destination vector.
enum ProjectileSpread:
ProjectileSpread NONE = 0
ProjectileSpread LINEAR = 1
ProjectileSpread ANGULAR = 2
ProjectileSpread CIRCULAR = 3
ProjectileSpread EVENLY = 4
Projectile instances will not spread.
Projectile instances will evenly spread in the “y” axis by the vertical_spread size.
Projectile instances will evenly spread by the angular_spread angle.
Projectile instances will evenly spread in a radial manner.
Projectile instances will evenly distribute to its set targets.
enum ProjectileType:
ProjectileType AREA = 0
ProjectileType INSTANTIATED = 2
The most basic type of projectile. AreaProjectile2D are created, processed and manipulated entirely through the PhysicServer2D and are batch drawn by the ProjectileProcessor2D.
AreaProjectile2D are extremely performance efficient but are restricted to a single Texture2D and cannot have individual components.
InstancedProjectile2D are instanced copies of your given Scenes. These contain all their original components and scripts, but follow the rules of normal projectiles.
InstancedProjectile2D are more performance intensive than AreaProjectile2D but not significantly, you would have to generate thousands to see a clear difference.
Property Descriptions
float after_hit_angular_speed = 0
Angular speed used in seeking projectiles after the first hit (Useful for ricochet behaviors).
bool allow_rehit = false
If true
the projectile will be able to hit already hit targets.
float angular_speed = 0
Max distance rotated in degrees per second in seeking projectiles.
float angular_spread = 0
Fixed radial extension in which angular spread projectiles will evenly distribute (in degrees).
bool area_monitoreable = true
AREA Projectiles ONLY
If true
the projectile can interact with other areas.
float cast_radius = 200
Radius of the sphere cast used to search for secondary targets on seeking projectiles.
int collision_layer = 0
Physics layers of the projectile itself.
int collision_mask = 0
Physics layers that can interact with this projectile.
String collision_path = "Collision"
INSTANTIATED Projectiles ONLY
Path to the mandatory Area2D element or child component in the Projectile2D instance Scene.
int damage = 1
Sum of health points that this projectile removes from targets.
PackedScene instance
INSTANTIATED Projectiles ONLY
The Scene to instantiate as a Projectile2D.
int instances = 1
Amount of projectiles to instantiate.
float lifetime = 1.0
Active duration in Seconds.
float linear_deviation = 0
Random amount of deviation the velocity vector of the projectile can differ once instantiated (in pixels).
float linear_speed = 1000
Distance traveled in Pixels per Second.
bool lock_to_target = false
If true
the projectile will ignore all potential collisions in the way to hit its assigned target.
bool look_at = true
If true
the projectile will actively look at the direction it travels.
ProjectileBlueprint2D on_expired_projectile
Secondary projectile to be instantiated once the main projectile runs out of pierce or runs out of lifetime.
String on_hit_call = "damage"
Name of the method that the projectile will call upon collision (On the objects it collided with).
int pierce = 1
How many different targets this projectile can Hit.
ProjectileDirectionality proj_directionality = 2
The type of direction the projectiles will take once instantiated.
ProjectileSpread proj_spread = 0
The type of spread the projectile instances will take once instantiated.
ProjectileType proj_type = 0
Specific projectile sub-class this projectile will use.
int radius = 50
Size of the projectile Collision in pixels (The Collision radius of the projectile is affected by the size of the projectile itself).
bool randomize_positions = false
If true
the linear and angular projectiles positions will be randomly spread.
float rehit_cooldown = 0.1
Minimum amount of time between consecutive collisions.
int seeking_mask = 0
The projectile will actively seek targets on these Collision layers. Use it so your projectiles don't seek into walls.
bool seeking = false
If true
the projectile will actively follow its targets.
float size = 1.0
Applied uniform Scale of the projectile.
Texture2D texture = null
AREA Projectiles ONLY
Main projectile graphic texture.
float vertical_spread = 0
Fixed amount of linear extension in which linear and angular projectiles will be evenly distributed (in pixels).