How do I pass variables into my projectile to modify the speed it goes?

For example, if I want to have a charge up weapon where you hold the button down for a bit. This means that I charge up a variable by incrementing it while the trigger is held down. However I store both the damage of the projectile and the speed that it moves on the projectile itself. I am not really sure what will work best for passing the variables needed over to the projectile. A fully charged shot should do more damage and move faster.

This game needs to support multiplayer so doing this sloppily will likely result in annoying bugs.

Any advice?

1 Like

Hi

Read this, it might help

1 Like

Create a variable for speed/velocity however you want to set it up in your projectile blueprint, click to make it Editable, give it a tooltip, and check “Expose on Spawn” Now wherever you use “SpawnActorFromClass” and pick this class it will have a new extra input pin for passing in this variable.

Awesome! It works kind of.

One problem though.


Is there a way to get around this?

1 Like