How to change actor class array element?

Hello all! I have a master weapon class reference which is an array. I have 3 different blueprints in this array that are for a primary weapon blueprint, secondary weapon blueprint, and melee weapon blueprint. Is it possible to code a change to the primary weapon into a different blueprint and so on for the secondary and melee? Say if i pickup a different weapon on the ground, the class reference changes.

Hey again TheNME100!

I put a lil’ sumthin sumthin together for ya! This’ll switch them out just like you’re wanting.
image
You’ll input your weapon class you want to change to where I have the dummy, and I’d use a variable for each of Primary, Secondary, and Melee with defaults set of 0, 1, and 2 since arrays start at 0!

2 Likes

Thank you so much! Definitely saved me a lot of trouble!

I have another question for you if thats ok, is there a way to reference a child actor from a parent object?

Glad that worked out for you!

As far as referencing a child, generally no. You can cast, but definitely don’t do it on tick or anything. What is it you’re trying to do? There’s likely a workaround. Start a new post with that if you would! That way if I can’t solve it others will be able to see and help!

I’ll start a new post

2 Likes