I tried something else (well… a MILLION things) and I still can’t get anything to work. I’m looking at all these other people’s blueprints, doing the EXACT SAME THING, and getting nothing. I guess I need to take a break before I lose it.
What I would recommend is making an Actor BP for the gun, that way you can store gun-specific information in the weapon, then reference it later.
The reason the attaches are not working in your example, is because it is looking for a specific instance of the mesh/actor.
Here is an example that I was working on of a character that starts the level with a Melee weapon “Bendy Rod”. Bendy Rod is an Actor BP with the mesh component. By having this as a separate actor, I can have it do its own stuff without the Character having to think about it (It draws a trace through the rod to detect hitting something).
The reason the Cast is failing is because it needs a specific instance to reference. In your image it looks like “Rifle Gun” is a MeshActor, but that won’t work for casting. You would need to create/spawn the gun into the world, then drag from the return value to cast (the return value will be the instance). Casting to the SceneComponent would not be what you wanted anyway; The “Target is SceneComponent” means to reference something in the level already. All-in-all it is not needed to attach a weapon.
This is a lot of information, so you have any questions, feel free to ask, I am happy to help.
If I recall right it transforms the return value to something that the spawn transform node can read/use. If I’m right, you just drag from the yellow to the orange and UE4 should automatically make it for you. It’s been a while since I played with this project though!