Download

Bug with Boolean!

Hello everyone, I actualy have a really strange problem that I really can’t understand…

  • My game is multiplayer, with one host player & the other player as a client.
  • I have two BP :
    The player BP
    An object called “Torus”

—> When the player enter in the Torus, in order to use the effect of the Torus object, he have to press enter key. This will activate a boolean called "CanEnterTorus
------> The Torus check if the player boolean is “TRUE” & this variable is linked to a “Branch”

THE PROBLEM IS :
When a host player enter the “Torus” BP & press the key in order to launch the effect, the “Torus” doesn’t work properly… the player is teleported just a little, & just some of the effects are trigered

However, the Torus BP is working well for the host with this boolean
AND the Torus BP is working well for host & client without this boolean

-----------> BUT, I don’t understand why it’s not working, because when I use another boolean (the number 2 in the picture)…then it work…

Please tell me if more explenation are needed, I’m crazy about this problem that looks really absurd !!

I’m working on UE4.24.3

It seems a replication problem, but with your description and just the image you provided I cannot understand where’s the problem and what’s wrong with your BP.
Is the CanEnterTorus bool replicated? Why are you using “Launch1” NetMutlicast RPC? Where is this RPC called?

Hello @Scienziatogm thx a lot for your answer.

Actually CanEnterTorus bool is not replicated. However I’ve tried to replicate it and it doesn’t work.

I use “Launch1” NetMutlicast RPC in order to do some action on the player (like change material, rotate mesh, etc).
Actually RPC is directly called from the “Set Timer by Function Name”, however I’ve tried many & many things & different ways in order to make it work.

→ That’s why I’m trully lost, I don’t understand where is the problem…

It’s not an efficient way of replicating things. Don’t use RPC NetMutlicast, especially Reliable NetMulticast if you can avoid them. OnComponentBeginOverlap will be triggered on the server when an actor hits your capsule, so (1) is not needed and it can make security issues if a bad client calls this server RPC with external tools, so you can delete that.
(2) This should be just a function, but not an RPC, and since you used Switch Has Authority before, you know that this function will be executed only on server. Now use Replicated Variables w/ RepNotify instead of NetMulticast RPCs! I don’t know what you’re trying to achieve, but if you are the server and you set a Replicated Variable to another value, the new value will be sent to all clients, and with RepNotify you can do what you want when this value is changed, for example you can change a PointLight color or, I don’t know, make all players jump :joy: , it depends on you.
This is the most efficient way to replicate things relevant for the gameplay without making a huge lag.
I hope I was clear, I’m not very good at explaining things :joy: so if you have any questions, feel free to ask!

Again, thanks a lot @Scienziatogm for your time & help !

What I’m trying to achieve is to make the player rotate, change material, and some other Stuff. I want this to be visible by the player & also other players.
→ However, I can’t use RepNotify function because some BP are not taken into account in the function… (like timelines for exemple)…

Timelines have a tick to set them as replicated, so you can call them on server and their values will be replicated. Here you can find more infos about RepNotify: 1.4 - Variable Replication [RepNotify] | Unreal Engine Documentation

1 Like

Yes that’s right haha, thank you again :slight_smile: