Change A variable of an elem of array based on blueprint ?! NEED HELP
A made an array based on a Blueprint and Im trying to use this array as an inventory. The array type is a Base_Item blueprint (this : http://i.imgur.com/Q9sMD2j.png) It contains 2 variable, TextureBase(variable type: texture 2d) and Texture_Selected. I'm made an other variable named Item, (variable type: Base_Item( the same as the array)) and trying to set this as the 0 elem of my array. This is works perfectly so far, BUT when im trying to change the texture for the Array's first item (at index 0) I got error and it doesn't do anything.
Blueprint code :
Can somebody help me out what im doing wrong or how to change the Elem's variable's value after I added it to my array, because logically I think this should work perfectly and I don't understand whats wrong
Thank you for helping, and sorry for bad English(if I sad anything wrong, I'm not confident with my English)
asked Jun 28 '15 at 07:03 AM in Blueprint Scripting
your Item variable is Null, meaning the thing it references does not exist, and you cant get or set a property of a reference that does not exist.
you need to spawn a baseItem, or place one in the level, then use that to set your "Item" actor reference.
an array of blueprints (Actor References) needs to be filled with elements that have been spawned into the world, and currently exist, in order to do anything with the array elements.
another way to do this, would be to create a structure that has texture variables, and make an array of those structs instead. that would allow you to have an array of data without having to spawn each element into the world.
Follow this question
Once you sign in you will be able to subscribe for any updates here