Spawn Actor reference disappears when function is done

Hello everyone,

I’m trying to make a multiplayer game with dedicated server. My problem is, I have a function for spawn clothes and weapon. I’m storing these actor’s references in a array. These references disappears when this function is done.

This function works in multicast and multicast works in server. How do i prevent this?

hi @Larismus

If this is being called inside a function. Please check that you have not made “Local Variables” as these exist only inside the function and are lost once the function exits.

If you have then relocate the variables into the “Variables” section within your blueprint. they will then be persistent whilst the actor is valid.

1 Like

But it works if i am not connected to dedicated server. When i am connect to server this problem shows.

I solved the problem. I deleted the array and create 3 actor reference variable and I set them.

1 Like