How to add/access classes to/from an array?
I can't seem to figure out why this doesn't work on my own. I'm inserting a specific class into an array of classes at a specific location in the array. Then later trying to access that same location to get the class I stored there earlier, but it comes up empty.
If I try to do the same thing with an array of integers it seems to function in the way I want it to.
asked May 18 '14 at 11:23 PM in Blueprint Scripting
My problem was that I was't able to put anything into the array or get anything out of the array and I guess I resolved it somehow. I don't know what exactly happened. Using the exact same setup it wasn't working. Then I decided to add a tooltip for the class array and it suddenly started working. Removed the tooltip and it was still working. Tried replicating the problem by making a new class array, but now it just seems to work by default.
So while it's working now, I have no idea what caused it or what I really did to fix it.
answered May 20 '14 at 11:07 AM
From my experience, putting ANY kind of class input into a SpawnActor node ends in disaster, even if it initially works fine. It corrupts the return value even if the input is exactly the same. Maybe that is my only problem, but it could affect you as well.
Put print strings on both sides of the Spawn Actor node, to see that the input is what you expect and then confirm that the return value is also correct. Maybe put one in front of your Add Array too so you know what is going in is good.
If that all works, try using the return value on the spawn actor and plug it into something like the Target of a Set Material node. One of my main problems was this conversion working fine WITHOUT Class input(Manual class set on Spawn Actor), and then corrupting on project reload WITH Class input.
Your issue might be different, but if it is the same there may be some bigger problem that the devs need to investigate.
answered May 20 '14 at 09:09 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here