Attach Skeletal Mesh Not Happening in Game
I have another nagging issue that is probably so obvious I should feel ashamed... but I feel like I've hit a brick wall.
I'm trying to attach a skeletal mesh (the rifle from the shootergame) to my third person character's hands. Can anyone see anything that would make this not work as I assumed it would?
Edit, I know the socket names in each screenshot are different, I took them at different times after trying all kinds of different sockets, none of the sockets work.
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.
answered Aug 22 '14 at 10:27 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here