Picking Up Items With a Line Trace

There are 2 solution for this:

+) Use interface. Implement each pickup item blueprint with this pickup interface, then implement the pickup function. Then when your line trace hit some item, call the interface function, if that item did implement the pickup function, it will be picked up, else, nothing happen. Or instead of put the pickup function into individual pickup item blueprint, you can put it into your character blueprint, then use the pickup interface to check whether you can pick up that item by using a simple function that return a boolean value. Any pickup item blueprint that implement the function may return true, the other may return false, or something like that.

+) Inheritance and polymorphism (if you don’t know anything about programming, check out this link Introduction to Object Oriented Programming Concepts (OOP) and More - CodeProject ). Create a parent class, put the pickup function into that class, then create as many child class based on that parent class as you want, on the child class, you may change the static mesh, some effect function, description, override a parent function and so on. That way, when you line trace hit some some actor, cast that actor to the parent class and call the pick up function.

Note that i personally recommend polymorphism solution. And correct me if i wrong, but i guess you don’t have much experience with programming, and if it is true, either look for some programming guys to help, or read some book that teach you the basics of programming (function, variable, encapsulation, polymorphism, … basics stuff like that), either way will make your life easier if you want to advance further down your project.