A launcher owns where and how a projectile fires. The projectile prefab still owns its movement, contacts and effects.
Connect a launcher#
- Create a Launcher using the same dimension as the projectile prefab.
- Assign the prefab in the launcher's Basic settings.
- Create a child Transform at the muzzle or hand and assign it as Launch Point. An empty reference uses the launcher Transform.
- Choose Mouse/Touch, Drag to Aim or a custom input adapter.
- Set launch power and cooldown. Assign an Aim Camera if the scene does not have the right
MainCamera. - Under optional features, add or assign a trajectory preview. The linked path should begin at the same point as the fired projectile.
With projectile speed 12 and launch power 1.25, the initial speed is 15 units per second, subject to the launcher's configured power range. Gravity and wind then affect flight according to the chosen movement mode.
Switch projectile types with a loadout#
Create a Projectile Loadout from Create > ERAGANX > Projectile Toolkit Pro. Add an entry for each prefab with a unique Id, a display name and an optional icon. Assign the loadout to the launcher and choose the active index. Indices start at zero: the first entry is 0, the second is 1.
Leave overrides empty when the prefab already contains the desired settings. Add an override only for a deliberate variation, such as a different speed or cooldown. Invalid entries block a launch instead of silently firing the previous selection.
Select and launch through the launcher API when you own the surrounding gameplay code:
launcher.SelectProjectile(1); // second entry
launcher.SelectProjectile("missile"); // unique entry Id
launcher.LaunchSelected(); // respects cooldownChanging the selected projectile cancels a pending burst; the existing cooldown remains. A linked trajectory follows the launcher's selected projectile rules, while its preview distance and animation remain independent.