juanje89
NNormal
•Created by juanje89 on 12/10/2024 in #🤝ask-a-question
Creating a common element that moves
should this "moving element" be a prefab to be instantiated with Realtime.Instantiate ?
6 replies
NNormal
•Created by juanje89 on 6/4/2024 in #🤝ask-a-question
Cannot build after upgrading to Normcore 2.10.2
Great, just updated the package and works!! Thanks!!!
8 replies
NNormal
•Created by juanje89 on 5/30/2024 in #🤝ask-a-question
Non-vr spectator
It seems I got it working by setting the position of the XR Origin (XR Rig) to the desired position when the client connects as spectator
23 replies
NNormal
•Created by juanje89 on 5/30/2024 in #🤝ask-a-question
Non-vr spectator
Even though I disable the XR Interaction Setup (which has the XROrigin) the spectator spawns at the XR Interaction Setup position
23 replies
NNormal
•Created by juanje89 on 5/30/2024 in #🤝ask-a-question
Non-vr spectator
using Normal.Realtime;
using UnityEngine;
public class Spectator : MonoBehaviour
{
// Multiplayer
private RealtimeView _realtimeView;
private void Awake() { // Store a reference to the RealtimeView for easy access _realtimeView = GetComponent<RealtimeView>(); }
private void Start() { // Call LocalStart() only if this instance is owned by the local client if (_realtimeView.isOwnedLocallyInHierarchy) LocalStart(); }
private void LocalStart() { // Request ownership of the Player and the character RealtimeTransforms GetComponent<RealtimeTransform>().RequestOwnership();
transform.position = Vector3.up * 5; transform.LookAt(Vector3.zero); // Look at center of scenery } }
private void Awake() { // Store a reference to the RealtimeView for easy access _realtimeView = GetComponent<RealtimeView>(); }
private void Start() { // Call LocalStart() only if this instance is owned by the local client if (_realtimeView.isOwnedLocallyInHierarchy) LocalStart(); }
private void LocalStart() { // Request ownership of the Player and the character RealtimeTransforms GetComponent<RealtimeTransform>().RequestOwnership();
transform.position = Vector3.up * 5; transform.LookAt(Vector3.zero); // Look at center of scenery } }
23 replies
NNormal
•Created by juanje89 on 5/30/2024 in #🤝ask-a-question
Non-vr spectator
And the Spectator component does the following
23 replies
NNormal
•Created by juanje89 on 5/30/2024 in #🤝ask-a-question
Non-vr spectator
using UnityEngine;
public class AvatarRoleInitializer : MonoBehaviour
{
public bool isSpectator;
[SerializeField] public GameObject leftHand, rightHand;
private void Start()
{
if (!isSpectator) return;
gameObject.AddComponent<Spectator>();
Destroy(leftHand);
Destroy(rightHand);
}
}
23 replies
NNormal
•Created by juanje89 on 5/30/2024 in #🤝ask-a-question
Non-vr spectator
This is the script I have on the avatar (right now, I toggle the "isSpectator" manually for testing purposes, but in the future, it should be controlled by the target platform)
23 replies
NNormal
•Created by juanje89 on 5/30/2024 in #🤝ask-a-question
Non-vr spectator
Great, that is what I'm trying to do right now. I have created a script called "AvatarRoleInitializer" that is on my avatar prefab and it seems to work great, because I managed to remove the hands depending wheter it is a spectator or not, though I'm having issues setting the position of this spectator manager, but it is perhaps because of the XR Interaction Setup
23 replies
NNormal
•Created by juanje89 on 5/30/2024 in #🤝ask-a-question
Non-vr spectator
I tried to mix everything in one single scene, by having two Realtime objects (one for VR and one for Spectator) and activating one of them depending on the platform, however, i get the same error. One Realtime object has the RealtimeAvatarManager and the other my custom SpectatorManager.
23 replies
NNormal
•Created by juanje89 on 5/30/2024 in #🤝ask-a-question
Non-vr spectator
Ok, I'll try to make it all in just one scene, spectators and VR players
23 replies
NNormal
•Created by juanje89 on 3/21/2024 in #🤝ask-a-question
Syncing music
Do I need to subscribe to such event, or does OnRealtimeModelReplaced gets called automatically after adding the third parameter to the model?
67 replies
NNormal
•Created by juanje89 on 3/21/2024 in #🤝ask-a-question
Syncing music
I have tried the suggested script and it works when a client plays the AudioSource and then, another client connects to the same room; however, existing players in the room do not hear the audio. I believe this happens becauce OnRealtimeModelReplaced is executed when the client connects @Normcore Assistant
67 replies
NNormal
•Created by juanje89 on 3/21/2024 in #🤝ask-a-question
Syncing music
Great, I'll give it a try!
67 replies
NNormal
•Created by juanje89 on 3/21/2024 in #🤝ask-a-question
Syncing music
Though the response looks the same as the recipe
67 replies
NNormal
•Created by juanje89 on 3/21/2024 in #🤝ask-a-question
Syncing music
Oh, great, I'll try this!!
67 replies