In this tutorial we will replace the linetrace logic from FPS Game Starter Kit and make it use the system from Smart Linetrace Projectile by ND.Store. The reasoning behind this is if you need more options such as wall penetration, falloff and other things to tweak a weapon, but don’t want to use projectile based ones and prefer hitscan instead.
1. Create a new Smart Linetrace Projectile project
2. Create a new FPS Game Starter Kit project
3. Migrate Smart Linetrace Projectile into the Content folder of FPS Game Starter Kit
Since multiplayer is one of the major selling points in Smart Linetrace Projectile, let’s start there (yes this tutorial will cover both modes)
4. Open Replicated_WeaponBase, add a new component (smart projectile) and on the weapons begin play, simply add a sequence and this to it
4. Still on the Replicated_WeaponBase, locate the existing linetrace logic and disconnect it, hook up the one from Smart Linetrace Projectile intstead of it like this:
5. Optional, but if you want to increase health so that the damage falloff works trough walls, you can change that inside Replicated_CharacterBase and in the W_ReplicatedHUD widget add this:
6. Make sure your weapon child classes are set to be Hitscan and not Projectile based
Just open BP_WeaponBase, add the component and replace old hitscan logic, and make sure to enable the “Muzzle Collision Test” checkbox, this will make it work in third person mode too.