Real time modelq
How Do I create a realtime model with 3 different values and how Do I handle those values
2 Replies
Hi @fgamez1020. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To create a RealtimeModel with three different values and handle them in NormalVR, you can follow these steps:
1. Create a RealtimeModel:
This example creates a RealtimeModel with three different value types: int, float, and string.
2. Compile the model:
After creating your model, you need to compile it. In Unity 2021+, this happens automatically. For older Unity versions, you need to manually compile the model using the "Compile Model" button in the inspector.
3. Handle the values:
To handle these values, you can create a RealtimeComponent that uses this model:
This component allows you to set and get the values from your model. The changes will be automatically synchronized across all clients connected to the same Normcore room.
For more detailed information on creating and using RealtimeModels, you can refer to the following resources:
Synchronizing custom data
RealtimeModel
Remember that RealtimeModels should be partial classes and shouldn't inherit from any other class. Also, make sure to use the supported primitive types for your properties as outlined in the Supported Primitives documentation.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
<@1053407831916822528> Kapa.ai is still learning and improving, please let me know how I did by reacting below.