It is a bit complicated due to object oriented stuff and load order, and fact that actors in editor are not actors in game during runtime.
EDITOR LIES!
So you have actors:
- loaded in editor so you can edit them, some code rune on them but not always, editor PRETENDS all is in level
- then you have classes and class variables, in actors, those are just code
- and finally you have actors, real ones in real level, and those have correct variables, and are real actors not faked by editor
So for your barrel to work you need reference to real barrel actor. Else you get bug about null pointer.
Either barrel tells other actor “hi i am barrel, my pointer is: xxx”
or your actor gets all actor of class “barrel” and either explodes all of them or picks correct barrel.
however for you it is simple:
Event Hit returns “other”, which is general pointer that can be anything.
So get that “other” and cast to “barrel class”, which tells unreal this is my barrel dummy!
Then “other” is changed to barrel and you can do barrel stuff with it, like roll.