Actor array error Access none

I have an actor blueprint with an array of actors that I get a random one and try to teleport it but for some reason, it’s not working, I have an is valid node and it is valid but when it gets to the next one which is a teleport I get the error Access none

It’s also a valid index but yet now I get invalid now

If you can post your BP it will be easier to figure out.

I would guess that you’re using a random int between 0 and LENGTH.

But… you use it once to do the ‘is valid’ test, and the second time to read from the array. The second time, sometimes, the random int = LENGTH, but the last index is actually LENGTH - 1.

A much easier way to get random objects from an array is using the RANDOM node :slight_smile:

1 Like

Im using a random item and it works

2 Likes