liamc
liamc
NNormal
Created by juanje89 on 3/12/2025 in #🤝ask-a-question
Voice problems
There was a fix in 2.13.2, but i haven't updated myself to see if it solved the problem. But if you're below that version it'd be worth updating
13 replies
NNormal
Created by juanje89 on 3/12/2025 in #🤝ask-a-question
Voice problems
13 replies
NNormal
Created by DC on 1/16/2025 in #🤝ask-a-question
is there a way to count the connections to the room without using the Avatar Manager
A basic usage could look like this:
public class ConnectedUser : MonoBehaviour
{
void Start()
{
InstanceRegistry<ConnectedUser>.Register(this);
}

void OnDestroy()
{
InstanceRegistry<ConnectedUser>.Unregister(this);
}
}
public class ConnectedUser : MonoBehaviour
{
void Start()
{
InstanceRegistry<ConnectedUser>.Register(this);
}

void OnDestroy()
{
InstanceRegistry<ConnectedUser>.Unregister(this);
}
}
But for a normcore object you could register/unregister when the realtime model is replaced, so that its initialised at the time of registration. Or if it's a poolable object you could Regsiter/Unregister in OnEnable/OnDisable, etc.
11 replies
NNormal
Created by DC on 1/16/2025 in #🤝ask-a-question
is there a way to count the connections to the room without using the Avatar Manager
I use this pattern a fair bit in all projects, not just normcore projects.
public static class InstanceRegistry<T>
{
public static IReadOnlyCollection<T> Instances => _instances;
public static int Count => _instances.Count;

public static event Action<T> OnRegistered;
public static event Action<T> OnUnregistered;

static readonly HashSet<T> _instances = new HashSet<T>();

public static bool Register(T instance)
{
if (_instances.Add(instance)) {
OnRegistered?.Invoke(instance);
return true;
}

return false;
}

public static bool Unregister(T instance)
{
if (_instances.Remove(instance)) {
OnUnregistered?.Invoke(instance);
return true;
}

return false;
}

public static bool Contains(T instance)
{
return _instances.Contains(instance);
}
}
public static class InstanceRegistry<T>
{
public static IReadOnlyCollection<T> Instances => _instances;
public static int Count => _instances.Count;

public static event Action<T> OnRegistered;
public static event Action<T> OnUnregistered;

static readonly HashSet<T> _instances = new HashSet<T>();

public static bool Register(T instance)
{
if (_instances.Add(instance)) {
OnRegistered?.Invoke(instance);
return true;
}

return false;
}

public static bool Unregister(T instance)
{
if (_instances.Remove(instance)) {
OnUnregistered?.Invoke(instance);
return true;
}

return false;
}

public static bool Contains(T instance)
{
return _instances.Contains(instance);
}
}
11 replies
NNormal
Created by s_q_u_i_s_h on 10/12/2024 in #🤝ask-a-question
Intermittent issues with voice in our Apple Vision Pro app
That doesnt sound right. A single coroutine per voice instance with a couple of null checks once a second shouldn't have a measurable cpu cost.
26 replies
NNormal
Created by s_q_u_i_s_h on 10/12/2024 in #🤝ask-a-question
Intermittent issues with voice in our Apple Vision Pro app
No description
26 replies
NNormal
Created by Killikario on 8/20/2024 in #🤝ask-a-question
Scripts Disabling
Do you have any exceptions or other errors in your console? Unity will disable scripts if they have a null reference exception in start function for example. But that's a unity feature, not normcores fault
19 replies
NNormal
Created by dontworry on 7/1/2024 in #🤝ask-a-question
How can I distort the mic audio in RealtimeAvatarVoice to be higher or lower pitch?
No problem!
24 replies