Does anyone know how to stop this error message from popping up? I’ve tried a few ways but have had no luck.
Here’s the snippet it’s referencing
Does anyone know how to stop this error message from popping up? I’ve tried a few ways but have had no luck.
Here’s the snippet it’s referencing
have you already tried removing the entire part about “get all actors of class”
Each client for example considers itself as index 0 so in the case above it looks like the top custom event is the client side of things so you’ll never have more than 1 or since we start at 0, player 0 unless you have a split screen player in which case you’d want to get the number of players and do the above run it for each player and using the custom even to pass in the player index
The yellow NO’s are because timers should be used here instead of delays
Here’s the why
Im guessing you had to add them to avoid an infinite loop, hence why we blue X that for loop
I’m guessing your trying to teleport all players somewhere
Changing it to the above should work… if your worried about players using this to hack or something simply have the server portion of the code check if they’re allowed to teleport and if the location is an expected location
hope this helps
And may i recommend finding a way to make the resolution of the screenshot slightly better
you can increase the size of everything to readable sizes with the widget reflector
Found in the top left of editor under Tools>Debug>Widget reflector here you can change “application Scale” to make everything bigger or smaller to read
Or if you’d rather leave that alone This is quite a useful site when you need to fit large blueprints into a single screenshot
Sorry, to clear up a bit of confusion. This code is to teleport an actor to a random players location. The bits you marked with a blue X is to get all the players locations and have it randomly pick one. Also, the delays are there to help me workout exactly when things are about to finish and call the next sections. I had made another post asking for help with getting a random players location but had no replies (think I posted it to the wrong section). This is the solution that works for me. It all works as intended, I just get that error after I finished testing it.
So you’ll have to find another method of getting another players location
Perhaps running it on the server will work
I haven’t much experience with replication but i know almost without a doubt that this is why you are getting the accessed none
If we have 1 player @ index 0 and we look for a player at index 1 ( player 2 ) there will be none
This may help you with figuring out the getting players thing, i hate linking to reddit but seems like a decent post
I have tired many ways of getting a random players location, but nothing seems to work. When I look for a tutorial they describe this method so I tried to fit it in for this specific actor. This is my first time doing something for multiple players, so I’m not really sure if any of the solutions I am using are good or will cause a lot of issues. (I am aware the quality is poor, I’m currently using a broken monitor so I have is zoomed out so I can see it on the good part of my screen lmao). I will have a look through everything you have linked and try those solutions. Thank you so much for the help!!
Use the GameState Bp to store your players location from each client in an Array
When you goto do the teleport compare your location to the array of all locations and remove/ignore this index in the array
finally get the array length and use “random integer in range” to pick the new location and pass that as your location to be teleported to