If I have an array of paper tile map soft refs can I get one from the array and then cast it onto a paper tile map actor? it’s my understanding that they are the exact same thing except an actor is actually in your scene.
What I’m trying to do with the soft references is not load up the tile maps that I’m not using. So if I do a paper tile map actor soft reference it forces me to pull every single tile map that is in my array onto my scene which I’m told will give me performance issues. Having it the current way I do I cannot get the correct ref of the tile map I wanna load, and then manipulate it via the move actor node.
I’m guessing I don’t really understand soft refs because if you have to do an actor soft ref it’s already in your scene and then is always loaded into memory.
It might be informative to right click on that BP in the content browser, and choose ‘size map’. I think you might find that, even though you’re using soft refs, everything is loaded.
In any event, I think you have to use
and then spawn an instance.
The only way I found to keep the other classes out of the size map was to mention it literally, like so
Which I can understand is a pain if you have an array. There is a good Epic vid on this, but can’t find it for the life of me, rn…
I understand the goal is to have 1 actor manage X number of random classes without having to include them directly. As I understand it soft ref variables are there to load assets when we need them. For your specific situation, unless you need to access something specific from the tile classes you can cast them as Actor and use that to reference and manupulate them.
If the soft ref variable is of type Actor you can set its value to what ever class inherits from it and it won’t be added to the size map.
You could try comparing the Path String of the already spawned tile to the soft variables in your array:
But perhaps you don’t need an array of soft references. Since you are only interested in the spawned tiles you can manipulate / create instances from them:
Adding cast nodes will include the class defaults to that BP (loads it). Casting to Actor won’t add anything since all blueprints already inherit from it and since Actor class has everything to move and such then it should be enough.
If you still need to access specifics of the tiles an option could be to create an abstract tile class with the comon functionalities and have the children extend it.
Hope it helps… and I didn’t make any mistakes. It can get a bit confusing. lol
Sorry i suck at forums so idk how to link the replies to specific things. @ClockworkOcean ill watch the video and see what i can learn form it.
@pezzott1 i wish i knew how to include pictures to show what im trying to do. Basically i have an 16 arrays of paper tile map soft refs, each array holds 8 paper tile map soft refs. So basically i get my actors location and figure out which direction he is leaving the current map to decide which tile map to load next(so basically i did a make shift 2D array in BP). The issue im running into is since im getting the soft obj ref i cannot cast it onto a paper tile map actor even though my understanding is the only difference between the obj and the actor is the actor is actually placed into your world. I could switch it over to a paper tile map actor soft ref, but then i have to place EVERY SINGLE paper tile map i wanna use into my world which would load them into memory and then defeat the whole purpose of the soft ref (from what i understand lol).