Hi, Im fairly new to ue4 and been working on a twin stick shooter. atm i can shoot projectiles and kill the enemies with it but im thinking of adding a feature of colour coding the enemies and switching between different coloured projectiles so that only the projectile of the respective colour to the enemy would actually damage it. And im struggling to find a way to do this. Please help. Thank you very much.
You can create gameplay tag for your enemies. also Apply same tag to projectile. e.g. Blue enemy’s tag is Blue so your Blue projectile tag also be Blue.
Create two variable of Projectile class. one for each type. One some input event like space toggle between them.
when your projectile hit an enemy check that enemy has same tag as projectile. if they have same tag apply damage.
I hope this help.
i see two options here. for the first i assume your using something like a spawn actor of class node. if so then just promote the class pin to a variable.this way you can just set the variable and it will spawn a different projectile. the other method would be to change variables within one projectile actor to match the settings you want. so for example you could modify linear color variable which is used in the projectile blueprint to set the material color.