Hi Guys,
Is it possible to do a skeletal mesh to skeletal mesh attachment within blueprints? I am in need of attaching a skeletal mesh weapon to my skeletal mesh character and I need to know how to do that. Thanks in advance.
Of course. Create a socket in the character mesh at the location you want to attach the weapon, then create a skeletal mesh component in the BP and parent it to the character mesh, and finally set the attachment socket for the weapon to the socket you created for the character mesh.
In line with this question, what would the best way be to handle the simultaneous animation of two skeletal assets attached in this manner? e.g. to animate the player and the gun in a way that is frame-for-frame synchronous, such as for a reload animation.
I don’t know how to animate a skeletal mesh unless it’s within its own BP.
That’s a good question RythmScript. I don’t know the answer.
I mean since we can now attach sockets to static meshes (BTW, very cool Epic) that will handle muzzle flashes quite nicely. The only thing left that I figure is a weapon still needs to be skeletal meshes in order to have reload, equip and putdown animations applied to them. That’s why I was looking for this feature. Perhaps you just create those anims for the character and the type of weapon you have (i.e. character with pistol, character with rifle, character with rocket launcher etc). Or perhaps those anims are just created for the FPS hands model? I don’t really know the right answer.
To animate mesh, you can use anim Blueprint or you can just play animation on the SkeletalMeshComponent using PlayAnimation function. The latter can play only one animation at once, no blending.
To support blending between you’ll have to use anim Blueprint with montage.
As for reload, we don’t have sync system between two separate SkeletalMeshComponentes. For Gears, weapon just used single node system - i.e. PlayAnimation above without animation blueprint - and reload worked fine by triggering at the same time. Often reload is short enough thatn desync is rarely noticeable.
If you’d still like to sync manually, I’d think, using player animation data (probably montage for reload) and sync to weapon animation using SetPosition.
–Lina,
This only matters if you’d like to animate weapon itself - i.e. reloading - switching magazine - not player reload animation. Otherwise you won’t need weapon animation. To animate, you still have to have skeletalmesh.
–Lina,
One thing I forgot is we have Master/Slave Component system that you can possibly use to sync two SkeletalMeshComponent, but this only works if slave contains a part of master pose component. In this case, the player should contain all weapon bone, and the weapon will mount on the player, then player plays one animation including weapon reload, then weapon will sync up correctly.
However, this can cause difficulty if you have a lot of different types of weapons you’d like to attach to player because you’ll need more sets of bones to cover all weapon types and animations.
This system is very useful when you have customization of different parts of body and play animation together.
Thanks,
–Lina,
I got to thinking that we might even be able to eliminate the “reload” weapon animations since we now have sockets on static meshes. In theory, you could attach a “clip” static mesh to the weapon static mesh via sockets. When you need to reload the weapon, you could just turn the visibility of the clip mesh on or off. This would probably work for most situations. As for the equip and putdown animation, it might be better handled via a character animation. So maybe weapon don’t need there own set of animations anymore.