Hi,
I’m working on a infinite runner-like blueprint that adds static mesh components to itself at runtime along a random generated spline.
I want to delete the components that are behind the player position therefore I store all the added static mesh components to an array of structs that have a static mesh component reference and its distance along the spline:
But I always get a Accessed none trying to read propriety Static Mesh_blablabla on the “Set visbility” node.
Am i storing the components in a wrong manner? The components are there because I can read the distance and the name of the component. Can anyone tell me if I’m missing something?
Hard to tell. You delete the mesh but what happens to the struct? Perhaps you end up with a struct array entry with a dangling pointer to the deleted mesh? Does your N index account for that?
Also, here’s a quick alternative since that should be quite performant and suitable for infinite runners. It does not rely on indexing and is event driven. It may not fit with your game design / concept though. I’m gonna leave it here in case you want to experiment: