Continuous Laser Beam Ability
In this tutorial, you will acquire the knowledge to craft a continuous laser beam ability that inflicts damage to targets for the duration they remain within the beam's path.
Last updated
In this tutorial, you will acquire the knowledge to craft a continuous laser beam ability that inflicts damage to targets for the duration they remain within the beam's path.
Last updated
On Animation Sequence, add “Mnh Anim Notify Tracer” on the timeline.
Configure the parameters of the "Mnh Anim Notify Tracer" to define the hitbox of the laser beam accurately.
Create a corresponding Tracer on the Mnh Tracer component of the Actor. Ensure that the Tracer Source is chosen as "Anim Notify," and make sure Tracer tags match. Additionally, set the Filter Type to "None" to enable the beam to inflict damage on targets with every tick.
In the Begin Play event, initialize the Tracer, and initiate the animation. The Tracer will automatically start when the Anim Notify is triggered during the animation.
After the animation, call the "On Tracer Hit Detected" event. Following the execution pin, incorporate a node responsible for dealing damage to target actors. To accurately calculate continuous damage, multiply the damage by the DeltaTime obtained from the "On Tracer Hit Detected Event." Traditional Tick DeltaTime may be inaccurate in this scenario since the Tracer's tick rate is not necessarily synchronized with the game's. The Tracer's tick rate is controlled by the "Tracer Tick Type" parameter in the details panel. Utilizing the output DeltaTime of the "On Tracer Hit Detected Event" automatically supplies the correct DeltaTime, considering the Tracer's specific Tick Type and ensuring precise continuous damage application.
It's crucial to note that the Mnh system conducts hit detections against the entire shape. In cases where the Tracer's hitbox is large enough to pass through obstacles, the system might unintentionally deal damage to actors situated behind blocking obstacles like walls. This is especially true in this tutorial where area covered by laser beam is quite large. To mitigate this, incorporate a line-trace verification step to ensure that the target is reachable by the beam. This additional step helps prevent unintended damage application to actors obstructed by obstacles.