How to implement magic powers (kinda like in Bioshock)

In this tutorial we will integrate a component that I made for people that want to add magic powers to their game, it works similar to how it does in Bioshock. Basically right hand is holding the weapon, while the left hand is used for powers.

1. Download and extract the BP_MagicPowers_Component

2. Open BP_CharacterBase and add the component to it, then create the widget on begin play and add it to the viewport, and use any key for using the powers, like this:

It comes with a pickup that you can use to fill magic (by default it goes into the inventory, but you can add overlap logic to do the same that the Event BPI Use Item does).

To add more powers, simply add them in the enum and inside the component and add what the new entry does on the switch node (thunder and fireball are already there as examples).

To tweak the distance, simply increase/decrease the linetrace in the component.

You can also change what it does if the linetrace hits something, by default it deals only damage, but you can add like a branch and compare the hit actor with a specific one and if true call an event from it (similar to how vehicle call the hit event on enemies if you drive into them), you can also expand the linetrace didn’t hit anything (or just increase the linetrace by a lot and add a blocking volume far up in the sky, to make sure it always hits “something”)

Also in case the widget and pickup don’t want to compile, it means they didn’t get the reference that the character has that component now, so just drag a new one from it and max/current values and connect it as it was before.

That’s it!