How to spawn shield effect?

My main character and the shield effect i want her to use comes as 2 different actors. If i want my character to use it while not moving, would i normally just spawn the actor at my characters location or create all the variables and code from the shield BP and put them into my main characters BP?

Hi there,
Given that you have two actors, you add your spawn code inside your player character as an “ability”. So, your player will activate the shield by calling “spawn actor from class”, class being the shield actor at player’s location. Then, use “attach actor to actor”, having the player as the parent actor input:

If your code is inside your player character, you can replace “get player character” by “get a reference to self”.

Hope that helps

1 Like

So, the stuff in the shield BP’s construction graph, i would just add that in my main characters construction graph?

Hi there,

Better this way. Keeping the “interaction” logic inside your character BP gives you better control of adding/removing your “abilities”. So, you can add this logic to your character BP and call spawn/attach from there. However, the shield effects and all related “ability” logic must remain inside the Shield BP or any other ability you might have.

Hope that makes sense.

1 Like

Thank you for the help! It would be best if i had changed the rules on the spawn actor. xD

1 Like