Using a blueprint variable?
Hey! I am trying to create an Inventory system. I was thinking about making a new class for each weapon, as I am trying to create a rather diverse arsenal and not all weapons will be using the same type of function to fire. The problem is, that I am only aware of single classes being available as variables. Am I wrong? Is there anything I could do to adjust my scripts etc.? Any advice is appreciated. Thank you in advance!
asked Jun 20 '14 at 07:12 AM in C++ Programming
You can use inheritance for this. Providing all your classes inherit from a common base class (eg
Your AWeapon class would declare a virtual function called fire:
Then you call the Fire method and the relevant method will be called.
answered Jun 20 '14 at 08:17 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here