How can I see realtime model values in unity editor?
I want to see what the current owner and values of my model are.
3 Replies
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:
----------------------
To see realtime model values—such as the current owner and property values—of your model in the Unity Editor when using Normcore, you can use the Inspector for built-in components like RealtimeTransform and RealtimeView. Here’s how you can do it:
1. Inspector for RealtimeTransform and RealtimeView:
- When you select a GameObject with a
- For
- These interfaces are designed to help you debug and monitor the state of your networked objects in real time, including ownership and synchronized values
RealtimeTransform
RealtimeView. 2. Custom Models:
- If you have custom realtime models, you won’t see their values directly in the Inspector by default. However, you can add debug logging in your scripts to print out model values and ownership information during Play mode.
- You can access properties like
RealtimeModel reference. 3. Ownership Information:
- Both
RealtimeView reference
RealtimeComponent reference. Summary:
- Use the Inspector in Play mode to view and interact with ownership and synchronized values for built-in components. - For custom models, use debug logging to inspect values at runtime. - Ownership and model state are accessible via properties on the relevant components. If you need to see custom model values in the Inspector, you’ll need to implement custom editor scripts or use debug logging, as the built-in Inspector only shows values for built-in components and public fields. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
- When you select a GameObject with a
RealtimeTransform or RealtimeView component in the Unity Editor during Play mode, the Inspector will show you the current state of the component.
- For RealtimeTransform, you can see and interact with ownership (e.g., using the "Request Ownership" button), and observe the current owner ID and synchronized transform values.- For
RealtimeView, the Inspector displays ownership information, including the current owner and options to request or clear ownership at runtime. This allows you to see which client currently owns the object and its components, as well as the unique identifiers and component list for the view.- These interfaces are designed to help you debug and monitor the state of your networked objects in real time, including ownership and synchronized values
RealtimeTransform
RealtimeView. 2. Custom Models:
- If you have custom realtime models, you won’t see their values directly in the Inspector by default. However, you can add debug logging in your scripts to print out model values and ownership information during Play mode.
- You can access properties like
ownerIDSelf and your custom fields from your model or component script and log them to the Console for inspectionRealtimeModel reference. 3. Ownership Information:
- Both
RealtimeView and RealtimeComponent (including RealtimeTransform) expose properties such as ownerIDSelf, isOwnedLocallySelf, and related ownership flags, which you can view in the Inspector or access via script for debuggingRealtimeView reference
RealtimeComponent reference. Summary:
- Use the Inspector in Play mode to view and interact with ownership and synchronized values for built-in components. - For custom models, use debug logging to inspect values at runtime. - Ownership and model state are accessible via properties on the relevant components. If you need to see custom model values in the Inspector, you’ll need to implement custom editor scripts or use debug logging, as the built-in Inspector only shows values for built-in components and public fields. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
<@185325614775926784> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
you can make a public field for e.g. score and then make score = model.score in update and then you can see the value in the inspector