Why this blueprint don't work? (weapons switching and firing)

Hi, I’m very new in Unreal and in blueprints, I’m trying to make a little top down shooter from a french guide that i’ve followed

I’ve completed it and now i’m trying to add more functions to it.

I add the multiple weapons in array, BP_Rifle (0) and BP_RocketLauncher (1) are Child of BP_Weapon where I’ve done the fire logic, the switching with 1 and 2 keys work with “actualweapon” used as a variable.

But the shooting only work with the RocketLauncher and not the Rifle, and I can’t figure whyyy !!

When I shoot with the rifle it look like the weapon is shooting from the origin point of the world (0,0,0) and is shooting the projectiles of the BP_RocketLauncher and not it’s own…


RocketLauncher working correctly, sphere in red is explosion radius


Rifle not, still explosion radius and it’s at the center


Logic for referencing BP_Weapon


Equiping weapons logic


Fire logic on the BP_Weapon (parent)

After lot of times I finally resolved it, for the ones who want to know.


It was the cast to BP_Weapon who was needed

Don’t know really why tho, since I put him has a variable at the BeginPlay and “get” that variable as the target for the “Start Firing Projectile” event.

If someone knows why… I’m interested !

Instead of casting have your weapons implement an interface with StartFiringProjectile and StopFiring projectile. Then you can just call the interface functions on the child actor without the cast.