Alix Ollivier
Alix Ollivier3d ago

Automated UnityEvent Sync?

We want to start sending UnityEvents across the network, and were wondering if there was an automated way in Normcore to sync them, or if we'd need to make a separate model for each UnityEvent that is called, or an EventBus with a network model.
2 Replies
kapa.ai
kapa.ai3d ago
Hi @Alix Ollivier. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Normcore doesn’t provide any automatic / generic syncing for UnityEvent itself. There’s no built‑in feature that will inspect and mirror UnityEvents across the network. The official guidance is: - Avoid RPC‑style messaging as your primary pattern; instead, store state in the datastore via RealtimeModels and let late‑joiners get a full snapshot automatically.[Why Normcore – Datastore] - Use RPC‑like patterns only as a last resort, because anything driven purely by “fire‑and‑forget” events is hard to keep consistent, especially for late joiners.[Room RPCs] For one‑shot “event” behavior, Normcore shows a recommended pattern using a model as an event carrier: - Create a RealtimeModel with fields for whatever you’d normally send in an RPC (e.g., trigger counter, senderID, position, parameters).
- Increment a trigger field and set the data to “fire” the event. - Subscribe to a change / callback on that model to invoke local behavior (e.g., play particles).[RPC Events recipe] Example: the ExplosionEventModel + ExplosionEvent RealtimeComponent pattern is exactly this “event bus via model” approach.[RPC Events recipe] Applied to your case: - There is no automatic syncing of arbitrary UnityEvents. - You have two realistic options: 1. Per‑event models / components (like ExplosionEventModel): simple and explicit, good when you have a small set of important events. 2. A custom EventBus‑style RealtimeModel that encodes “event type + payload” and a single RealtimeComponent that decodes and raises the appropriate UnityEvents on each client. This is effectively a generalized version of the RPC Events recipe; Normcore’s docs don’t show a generic bus, but the pattern is directly supported by the model + callback system.[RealtimeModel] If you need late‑join safety or persistent effects, prefer modeling the resulting state in RealtimeModels rather than just mirroring UnityEvent calls; use the event‑model pattern only for visual / transient effects where occasional desyncs are acceptable.[Why Normcore – Datastore] ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3d ago
<@185325614775926784> Kapa.ai is still learning and improving, please let me know how I did by reacting below.

Did you find this page helpful?