Bp_WeaponPickup - Construction script not functioning for weapon preview.

Hi, I was wondering if someone could explain an issue I’ve been having with my blueprint as I can’t wrap my head around it.

What I want is to make a Core Pickup blueprint that I can attach a weapon to using a Core Weapons blueprint, so I can have multiple weapons without having to make a copy for each pickup.

For this pickup blueprint, I want to use the construction script to preview the attached weapon class but for whatever reason whenever I use the skeletal mesh of the attached weapon, it bugs out and refuses to display the weapon.


Image 1: The pickup blueprint placed into the world space with an attached weapon variable “bp_weapon”.


Image 2: My attempt at creating a weapon preview using the bp_weapon to change the skeletal mesh in the pickup blueprint


Image 3: The bp_weapon with a skeletal mesh using the weapon of choice.

I was unable to get an image of it also, but when I did this same exact code before, it would produce an error saying “Accessed none…” for the skeletal mesh component of the pickup and would lead to the “set skeletal mesh” part as seen in image 2. Unfortunately I’m unable to reproduce it (despite doing the exact same thing).

If someone could explain where I’m going wrong or a possible solution, I would be very thankful. I’m pretty much losing a lot of motivation to continue with this project and am considering throwing in the towel with such a small thing giving me a large amount of hassle, so I’m practically asking for any sort of victory at the moment.

Get Actor of class does not work in the constructor or the c++ CDO.

Execution order:
Constructor => before the game world exists
Begin Play => after game world exists.

You need the Game world to exist and be populated with actors before you can use get actor(s) of class.

Thank you, I was struggling to understand how construction script function properly and wasn’t aware Get Actor of Class wouldn’t work.

With this in mind I’ve removed the get actor and weapon part, and have decided to change the mesh manually as a variable instead and it’s working now. I still have the Weapon class variable but I think I’ll just keep it to contain the data and spawn the weapon.

I was getting rather chewed up about it so I sincerely thank you for your explanation, it cleared things up quite a bit.

If you want modular weapons then look into data assets.

You can inherit from data asset primary in blueprints. It’s a lightweight way of storing information about actors. Look up some youtube tutorials it might be helpful in the future.

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