What is the best way to find and use the Skeletal Mesh component from a Blueprint at Runtime?

Hi all, this is potentially quite a silly question, but I’ve been banging my head off of it for a few days and cant find nor think of an answer!

  • I’m working on adapting the FPS Template in Unreal 5.2.1
  • I have adapted the BP_ Pickup_Rifle blueprint to add a weapon to the player based on a class reference, which would be a child blueprint of the default sphere launcher weapon

  • I want to change the Skeletal Mesh of the weapon pickup to match the skeletal mesh of the weapon component that has been selected
  • The only way I can find to do this is by adding the weapon component to the pickup, then applying the mesh when the Blueprint is activated

  • This seems a silly/inefficient way to do things, and I’ve no idea if there will be bigger consequences I’m not realising!
  • Is there a proper way?

I recommend Data Asset to switch your weapon mesh: https://youtu.be/Pb0uhYoUmb8?si=4dcV_4E90wmEls-u

Or data table but you will need to use WeaponID, Skeletal Mesh(as soft ref) and load them manually to save memory.

Perfect solution thanks!

I’ve created a Data Asset that stores a Skeletal Mesh and a Class Reference, and I’m using that to set up the weapon pickup.

Thanks for the help!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.