I’m trying to make a campfire but I can’t activate it using a client, just the server
i wanted campfire to be started by both
Hi Obline,
I have hard time following blueprints but it doesn’t look like you’re doing a multicast. You’ll want to use a multicast for the fire to be lit on all clients. I would use the following pattern:
- Client calls Server_LightFire
- Server calls Multicast_LightFire
- Multicase_LightFire calls code to visually light the fire on all clients
The second issue you may run into is Net Ownership. Clients can only call RPCs on actor’s they own. By default this would be their pawn or controller. You would also need to set the campfire’s ownership to the client’s pawn or controller.
It’s better to use RepNotifies when something needs to happen on all clients, since a Multicast will only be called on clients who are currently network relevant. That way, if a client becomes network relevant later, they will have the state of the lit variable replicated to them and the RepNotify will be called, and the fire will light.
Also, it’s not necessary to set ownership of the campfire to the controller. Instead, you can have a Server RPC on the controller that calls the light function on the campfire.