Blueprint class scripting issues


I am not sure if this is the correct section for this type of post however I really have no idea what I am doing at this point. I have searched on YouTube, on these forums and on stack overflow and such to no avail.

Here is what my team is trying to do (it is quite possible we are over complicating this, however we are all new to Unreal and just starting in blueprint) Please also remember that we are programmers, doing a C++ build is not out of the question however we wanted to make our prototype using Blueprint to begin with so we could get it out as quickly as possible.

So we are attempting to make an array that pushes back instances of a “visitor” class, this visitor class is not something we want to spawn into the world it is instances of the class that we want to manipulate off camera. Yes we have accepted at this point that to make it work we may need to bind it to an actor in the world, we are not opposed to that.

The visitor class will have the following variables (just to start - for this example):


Now that is it for our Visitor class.

In our Visitor_AI class that we have bound to an actor in the world:

  • On Event start we want to loop 100 visitor class objects into an array, however we do not want these visitors to have the standard(default) variables in them, we want to be able to randomize all of the variables from Age, income gender and so on. We have not been able to find out how to do this at this point. We are unsure how to create an instance of the viewer class (without actually spawning it into the world) where we can set the variable data and then add it to the array we have stored in Viewer_AI. This is our largest problem and where we are currently stuck.

I have looked all over the documentation for blueprints (which I found was not very in-depth) and unfortunately could not find anything. Probably due to the fact that we are missing something on the base level that is just escaping us all. As anyone who is a programmer might understand this is truly frustrating for us because we could set up this little test in about 5 minutes in C++ on our own sprite engine, however we wanted to prototype and then move into C++ after the prototype is done. Having said that, like I noted we are not above moving into C++ now, it will just take some more learning of the interface and the syntax.

PLEASE let me know if there is anything that we are missing that will help us out! Any help is very much appreciated.

Please also let me know if you need any further explanation as to what we are doing, I can provide some sample C++ code really quick to show in code what we are trying to accomplish and would like to make using blueprints. During my searches all over the internet, we found that blueprint is very versatile and we are not naive enough to think that it is not capable of doing this, or that we have a complete understanding of how it works after only watching YouTube videos and working with it for a a week.

Thanks to anyone who can help out!


Quick bump - Not sure if this was seen or not.

hey there,

well if you are programmers, then went over to c++. It does not take more time than bp and its easier to maintain FMPOV. However, if you dont want to use the World->SpawnActor method then
use “Construct Object From Class Node” (i think thats how its called) to get you instances of your classes (at least i used that node the other time when i wanted to do such a thing in BP).

If you’re not looking to spawn the objects before you set their variables you could always populate your arrays with the randomised values on spawn and then use an id index system to assign them to each visitor as you spawn them. Don’t know if that might help…? I may just be reading the problem wrong.