PackedInfo

Inherits: RefCounted < Object

Projectile creation data container.


Description

PackedInfo is a data container class that holds initialization parameters for projectiles. It acts as a configuration package that can be passed to projectile creation methods to set up their initial state.

Note: PackedInfo is used extensively by the ProjectileProcessor2D for projectile initialization.


Properties



Methods



Property Descriptions

Callable collision_method = Callable()

Projectile custom collision handling callback.


Vector2 destination = Vector2.ZERO

Original destination the projectile is being headed.

Used for non-seeking projectiles with fixed destinations.


Vector2 direction = Vector2.ZERO

Initial projectile movement direction.


Callable expired_method = Callable()

Projectile custom expiration callback.


float headstart = 0

Projectile initial movement advantage.

Simulates projectiles that have been already moving before creation.


int instance_id = 1

Individual instance identifier for projectiles with multiple instances.


Callable move_method = Callable()

Projectile custom movement callback.


bool override_wait_time = false

Flag to bypass built-in wait time behavior.

Used for complex attack patterns with custom timing.


Vector2 position = Vector2.ZERO

Projectile start position.


Callable start_method = Callable()

Projectile custom initialization callback.


Node2D target = null

The target node that projectiles should home-in.

Required for seeking projectiles with target-tracking behavior.


RID world_2d = RID()

The physics server world RID for non-instanced projectiles.



Method Descriptions

void reassign_all(_position: Vector2, _direction: Vector2, _destination: Vector2, _target: Node2D, _instance_id: int, _world_2d: RID, _move_method: Callable, _start_method: Callable, _collision_method: Callable, _expired_method: Callable, _override_wait_time: bool = false, _headstart: float = 0)

Completely reconfigures all properties of the PackedInfo object.

Used for complex projectile setups requiring full parameter control.


void reassign_simple(_position: Vector2, _destination: Vector2, _target: Node2D, _move_method: Callable, _start_method: Callable, _collision_method: Callable, _expired_method: Callable)

Reconfigures essential properties for standard projectile setups.

Simplified version for common use cases that don't require advanced parameters.