I’m a beginner in UE4, and I’m trying to make an FPS game. In my game you have to pick-up or switch between guns which you can find in the level, and then kill monsters.
So far I made a character with movement, which can pick up guns when pressing “E” through a blueprint interface. When the gun is picked up, it is added to a socket of the character’s mesh. The Gun itself has a socket at the end of the barrel where my “BP_Projectile” spawns. “BP_Weapon” is aparent of “BP_M4”. BP_Weapon has two custom events (Start/Stop Shooting) which just change the “IsFiring” boolean. These two events are then used by their childs before spawning the projectile just to set the boolean.
My problem is how do I call these two custom events inside “BP_MainCharacter”. I tried using “Cast to BP_Weapon” but I need an object refrence. I made a variable of type “BP_Weapon” (Object Refrence) and plugged it in but obviously it doesn’t work. I know that the Cast to node basically makes sure the object plugged in is the right one, and if it is I can then access it’s variables and some other things. I’m sure there are other ways of doing the whole gun system but this was the easiest for me to understand.
I watched/followed some tutorials but I couldn’t find what I was looking for…