This document is about: FUSION 2
SWITCH TO

Expanding Project

Adding new weapon

  1. Create a new prefab or duplicate an existing weapon.

  2. Make sure that there is at least one WeaponAction component and appropriate weapon components on the prefab. WeaponAction and weapon components can be all on one GameObject (see Sniper prefab) or in case of multiple weapon actions it needs to be placed in hierarchy (see Rifle prefab).

  3. Set the WeaponSlot in the Weapon component to specify which place it should occupy in the player weapons array.

  4. Optionally assign weapon name and icon in the Weapon component.

  5. Assign weapon to Initial Weapons field in the Weapons component on the PlayerAgent prefab.

weapons inspector

Adding new projectile

  1. Create a new prefab or duplicate existing projectile. Make sure there is a component that inherits from Projectile.

  2. Assign projectile prefab to weapon prefab in WeaponBarrel component.

weaponbarrel inspector
  1. Assign projectile prefab in the HitscanProjectileBuffer or KinematicProjectileBuffer on the controlling object (e.g. the PlayerAgent prefab) to make sure it will spawn the projectile when fired.

Switch to third person

Fusion Projectiles is built as an FPS game but most of the functionality applies for TPS games as well. When firing in TPS games, first a ray needs to be cast from the camera to find the point at which the player is trying to shoot. The actual projectile cast will then be from a position on character (fixed position near character shoulder usually works well) to the point obtained from the camera cast. There are usually some tricks (like ignoring some collisions with second cast) involved so players won’t be hitting unwanted objects too much (corners issue). Check out Fusion BR for a TPS handling example.

Back to top