Normal

N

Normal

Join the community to ask questions about Normal and get answers from other members.

Join

🤝ask-a-question

💼jobs-and-opportunities

💾sample-code

🥂project-showcase

💭feature-request

✨normcore

💬chat

🚧wip-and-updates

Manually syncing position, rotation at 20hz?

If I were manually syncing an object position and rotation, should the model setter just be setting every frame or can resources be saved by setting it only 20x a second becuase thats what normcore would use anyway? It woudnlt' be in sync with normcores refresh anyway i'd assume so how does that work? Is there a way to sync at normcores refresh rate?
Solution:
```cs protected override void OnRealtimeModelReplaced(YourModel previousModel, YourModel currentModel) { model.onWillWrite += OnModelWillWrite; } ...

How do I check the latency of the connected player?

How do I check the latency of the connected player?
Solution:
---------------------- You can check the latency of the connected player in NormalVR by using the ping property of the Realtime class. This property returns the local client's last known ping with the server in milliseconds. Here is how you can access it: ...

I'm trying to use Normcore to send audio source data over multiplayer.

I specifically don't want the microphone data, I've recorded clips using the Microphone and playing them back and I'd like that playback to be synced. Is there any way for me to create an Audio Stream for each audio source I create?

Prevent ownership takeover isn't designed to be used dynamically during time correct?

If we have a rigidbody that multiple poeple may be touching but we dont want realtime transform to automatically transfer ownership of.

Change the Local Prefab Avatar

In the Realtime Avatar Manager class, how do I change the Local Prefab Avatar at runtime?

Can you get a client id directly from realtimetransform?

Can you get a client id directly from realtimetransform?

Able to connect to room from Unity Editor but get this error when building to the Quest 3

2024/04/10 19:16:36.282 9024 9045 Error Unity Realtime (native): BidirectionalClient: Connection Error: Unable to connect to normcore-matcher.normcore.io on port 3000, error: No address associated with hostname Any ideas what might be the cause?...

Custom avatar's animated hands not syncing to the network

I have a custom prefab linked as the Local Avatar Prefab on the Realtime Avatar Manager on Realtime + VR Player. In the scene I have a script using AvatarCreated() to SetActive(true/false) different nested objects in the avatar prefab so player 1 vs player 2 have different hand objects under the Left Hand and Right Hand hierarchy. Another script is on the Left Hand and Right Hand objects directly, which takes the controller's trigger value to blend an animation on the nested objects into clenching a fist....

the easiest way to check synchronized of transform object

I'd like to know that how to check the timeline by use stopwatch.

How to get local player?

How can i get the local player and assign it to a variable?

Why the Realtime instantiated object is not always ready

I am trying to instantiate objects that have RigidBody and no custom Realtime components. If I have three objects usually at least one of them is missing the Model. After Realtime.Instantiate call I try to call RequestOwnership but it fails with "Exception: This component doesn't have a model. Wait until the model is present before interacting with the ownership." error. This does not happen everytime. Next time I launch the game the same object might work and then next time it doesn't. I have not found any pattern on this....

Should a realtime custom component that is changing every frame be handled any differently?

Or should you still just use a didchange event even if it is changing every frame all the time?
Solution:
did change is probably better then

Toggle UI visibility on button clicked

I'm new to Normcore and working on an application moving objects and creating UI callouts for those objects when buttons are pressed. I have the synchronization for the objects working properly calling but am having difficulty showing visibility of the UI information. The UI is a child of each object so as it moves when the button is pressed or rotates with the slider the UI follows along with it. What is the best approach to toggle and sync this UI visibility?
Solution:
---------------------- To synchronize the visibility of a UI element in Normcore, you can create a custom RealtimeComponent. This component will synchronize the state of the UI visibility between the Unity scene and the Normcore datastore. Here's a general approach: ...

Setting position of object not updating on other clients

I am working on a script to allow for shooting. I am spawning bullets like this: ```csharp GameObject bulletGameObject = Realtime.Instantiate(prefabName: "Bullet", // Prefab name ownedByClient: true, // Make sure the RealtimeView on this prefab is owned by this client preventOwnershipTakeover: true, // Prevent other clients from calling RequestOwnership() on the root RealtimeView....
Solution:
---------------------- The issue you're experiencing is likely due to the fact that you're setting the position of the bullet after instantiating it. When you instantiate a Realtime prefab, it is instantiated on all clients. However, the position update you're making after instantiation is not being synchronized across all clients. To solve this, you should use the Realtime.Instantiate() method that allows you to specify the position and rotation during instantiation. This will ensure that the position and rotation are set correctly on all clients. ...

Constant force syncing

So if you have a constant force that is being applied to an object, Should you bother trying to sync turning it on and off between players or does it not matter because whoever owns it will simply control the rigidbody behavior anyway.
Solution:
no need to sync the extra force then

How to disable and enable the prefab with normcore

Hi. I'm new to the multiplayer game. I'd like to disable and enable the prefab in my game while running. I'm using .SetActive() now. How do I use normcore?...
Solution:
---------------------- If you want to remove the object at index 0 after finishing the loop, you can do so by calling the RemoveAt() method on the list. Here's how you can modify the previous example: ```csharp using UnityEngine;...

Disabling object with realtime view?

I see you aren't supposed to start with a disabled view but what about disabling and reenabling a realtime view during runtime after that?
Solution:
eh ok I found the issue it was getting disabled elsewhere. So I guess it's fine to enable and disable them as long as it's after they are registered.

Best way to support async room loading?

Lately we've been working on a feature to support faster loading of normcore rooms, so that we can split larger areas over multiple rooms and load/unload them as needed. I made an object pool to reduce Instantiations on the initial room load, and we preload the pool with the total number of RealtimeView instances in the room (we keep track of these on the "host" client). However, even doing this, there's a significant bit of lag when loading in the room (about 845ms with 6 players, testing with roughly 1800 RealtimeModels in the room. This is the higher end of the possible object count though. 240 objects would be more typical for 6 players). We have a lot of small networked objects in the room per player, so it's difficult to improve this by reducing realtime model instances, since they all have properties that need to be networked individually. What we've tried: - preload pooled object instances - pre-activate the pooled objects and move them off-screen...

Adding player and Object Physics

I wish to add Player and object physics but I don’t know we’re to start?