I need help getting location of a component from an array of actors.

im having trouble getting location of an mesh from an array.

array is a static mesh component array.

thanks

Hey bennetherwood,

This should function same way we discussed in this thread:

With exception of using Get World Location (which accepts Components) instead of Get Actor Location. What trouble are you having getting this to work?

i have played around with this a bit and array being generated isn’t seeming to load correct information? all actors i spawn from location of value in array is 0,0,0 is this default for an empty array?

That’s correct. It sounds like you aren’t setting values to your array properly. Can I see an image of your setup? What are you trying to use as your array elements? Are they components of Blueprint creating array?

i think it is because i am spawning actors from class on event begin play, then adding them to an array, then creating a master array in another blueprint ?

i will include a sample of how i add vars to array because graphs are huge

there are loads of BP for lots of different structures which are randomly spawned into a solar system BP

main BP is then a galaxy BP which spawns a random number of solar systems, i can do my method of spawning a actor from class at a location from a var in an array no problem in solarsystem BP but not in galaxy BP, so i think this is weak link, if 0,0,0 is default if there is nothing in array, i think that problem is that there is no values in array in GalazyBP as they aren’t carrying over from SolarSystemBP

(galaxyBP below)

thanks soo much for your help :smiley:

So you have a GalaxyBP, which spawns SolarSystem BPs, which spawn planets, in that order? Or are you creating SolarSystemBPs and then using GalaxyBP to collect them?

i belive so, yes, galaxyBP spawns solarsystemsBP, which spawns planetsBp (and a sunBP, which i think is irrelevant)

i have 1 instance in game of GalaxyBP ingame and it creates galaxy on event begin play

this is 1st part of graph, youve got 2nd (event begin play)

this is spawning event on tick action

yes they spawn at 0,0,0 no matter what happens, i need to raise a big point now that i wasnt going to raise here as i thought it was a separate incident, im not 100% sure but i think i still got it without spawning asteroids,
actually that when asteroid (in last pic) is spawned i think for everyone (because ive not counted them all and checked against tick time) they cause this error

ERROR/WARNING REPORTED IN EDITOR

then i click on it and this shows

“assessed none “call func_array_get_item” from node construction script in blueprint galaxyBP”

i neglected to mention as my construction script is completely empty ?

And Get World Location in that last image is one spawning Actors at 0,0,0? I’m going to set up a smaller version of what you have here to see if I can locate source of problem, but you have a lot more that I can’t see in these images so I may have more questions. I will let you know what I find.

Yea, that error pops up when you use a Get function on an empty array.

so is it that array isnt being carried across from solarsysyemBP to be appended to make a complete list of all various things (planets, stars ect)?

It’s hard to say without being able to see it in action. Would you feel comfortable putting project up somewhere and sending me a link so I can go through it? I want to help get your project working as you want but I also need to see whether there’s a bug in here somewhere.

alright, but assuming that you are staff, then will asset please not be distributed as its part of my game?

if so i would prefer sending it to a personal email rather than openly online.

You can PM me on forums with a link, or with any concerns about sharing project. Yes, I am Epic staff.

how do i send it to you directly?
i cant see option on your profile

yer thats what im saying how do i message you directly?

There isn’t one. Message me and we can talk about how to get me project.

Oh, I’m sorry. On forums:

sent it man !

ow and you can delete high floor solar in simulation whenever its spawned because it gets in way of seeing asteroids