How to NOT replicate something?

Ok, so in my 3D platformer, I have two main multiplayer gamemodes.

Gamemode 1. Players race through the level and collect pickups as they go. These pickups will dissapear for all players once collected by one player. This works!

Gamemode 2. Players race through the level and collect pickups as they go. These pickups will only dissapear for the player who collects it, but stays visable and collectable to all others. This does NOT work.

So my question is, how can I get the pickup to NOT replicate to other server or clients in the match when it gets picked up?

In theory, it should be as simple as turning off replication for the pickup, right? But this does not work, it still replicates reguardless.

I’m frying my brain trying to find a solution to this so any help or ideas are welcome!

Make sure that actor or it’s components are not replicated.
Then on collision check if overlapped player is local player.

Here you go @Manim8

I made it using custom game state, but it can be done different ways.

Custom Game State:
image
image

Object to destroy:


Delay needed to make sure that game mode variable is updated.
I’m using destroy from game state because multicast does not work if actor is not replicated.

1 Like

I’d change my approach.
You would still want the server to handle the pickup, so instead turning off replication, you could:
A) spawn pickups for each client on server, hide and disable collisions on clients that are not the “owners” of this pickup
B) spawn only one pickup, but have a replicated list of players, who picked up. On client, when that list changes, check if local player is in the list, if it is, hide the pickup.

1 Like

Wow, thanks! This looks good. I’ll try this tomorrow and see if I can get it working! :hugs:

It worked! Shunitzo, you are a true legend! Thank you for taking the time to show me this. Hopefully others will find this usefull in the future.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.