The Impact Projectile Spawner class supports projectile creation. It integrates a pooling system to optimize memory usage and improve performance.
This component can be added to any class wishing to throw projectiles. Firearm, turret, vehicle, etc.
Class Functions #
- Spawn Projectile : Spawn projectile. If enabled, it reuse projectile from pool.
- Spawn Projectile at Location : Spawn projectile at absolute position (World). Scale is not taken into account.
- Set Projectile Class : You can define the class of projectile you want to launch. It must be derived from the Impact Projectile class.
- Get Projectile Speed : Getter for projectile launch speed variable.
- Set Projectile Speed : You can set the launch velocity of the projectile. Only works if you have enabled Override Projectile Speed.
- Set Projectile Launcher : Set the component that launch projectile (Mesh, Skeletal Mesh or other)
- Set Homing Target : Set homing target component in each projectile that is spawn.
- Clear Homing Target : Clear homing target component saved, so projectile back to basic behavior.
Class Settings #
- Spawn Position Type :
- From Socket : Use socket in specified mesh to set location of projectile
- From Actor : Use owner location to set location of projectile. You can offset this location in relative space. See RelativePosition.
- From Camera : Use the player camera location to set location of projectile.
- Spawn Direction Type :
- From Socket : Use the forward vector of socket.
- From Actor : Use the specified forward vector of actor.
- From Camera : Use the forward vector of player camera.
- Projectile Class : Impact Projectile Class you want to use.
- Override Projectile Speed : If activated, initializes the projectile with the specified velocity.
- Projectile Launch Speed : [Only if Override Projectile Speed == true] The velocity you want to use for each projectile launched.
- Socket : [Only if Spawn Position Type == From Socket] Use socket in projectile launcher to spawn projectile at location and rotation. If not specified, use world location/rotation of projectile launcher.
- Relative Position : [Only if Spawn Position Type == From Actor] Position offset in relative space.
- Right Vector : [Only if Spawn Position Type == From Actor] If enabled, use actor right vector instead of forward.
- Use Line Trace to Fix Orientation : [Only if Spawn Position Type == From Camera] Check if you want to fix orientation issue when spawning a projectile from camera rotation with socket or actor location.
- Pool Size : Size of pool (0 = default value in settings). The number of projectiles that can be recycled.
- Draw Debug : If enabled, draw debug.
- Draw Projectile Direction : Useful to check if your spawn settings is correct (weapon orientation).