stickkdoesstuff
stickkdoesstuff
NNormal
Created by stickkdoesstuff on 10/6/2024 in #🤝ask-a-question
is there any way to sync text data onto a tmp?
also can you send the script
29 replies
NNormal
Created by stickkdoesstuff on 10/6/2024 in #🤝ask-a-question
is there any way to sync text data onto a tmp?
what do i do to this code? using System.Collections; using System.Collections.Generic; using UnityEngine; using Normal.Realtime; public class ColorSync : RealtimeComponent<ColorSyncModel> { private MeshRenderer _meshRenderer; private void Awake() { // Get a reference to the mesh renderer _meshRenderer = GetComponent<MeshRenderer>(); } protected override void OnRealtimeModelReplaced(ColorSyncModel previousModel, ColorSyncModel currentModel) { if (previousModel != null) { // Unregister from events previousModel.colorDidChange -= ColorDidChange; }
if (currentModel != null) { // If this is a model that has no data set on it, populate it with the current mesh renderer color. if (currentModel.isFreshModel) currentModel.color = _meshRenderer.material.color; // Update the mesh render to match the new model UpdateMeshRendererColor(); // Register for events so we'll know if the color changes later currentModel.colorDidChange += ColorDidChange; } } private void ColorDidChange(ColorSyncModel model, Color value) { // Update the mesh renderer UpdateMeshRendererColor(); } private void UpdateMeshRendererColor() { // Get the color from the model and set it on the mesh renderer. _meshRenderer.material.color = model.color; } public void SetColor(Color color) { // Set the color on the model // This will fire the colorChanged event on the model, which will update the renderer for both the local player and all remote players. model.color = color; } }
29 replies
NNormal
Created by stickkdoesstuff on 10/6/2024 in #🤝ask-a-question
is there any way to sync text data onto a tmp?
thanks
29 replies
NNormal
Created by stickkdoesstuff on 10/6/2024 in #🤝ask-a-question
is there any way to sync text data onto a tmp?
@kapa.ai Just so you know im using the vr player example
29 replies
NNormal
Created by stickkdoesstuff on 10/6/2024 in #🤝ask-a-question
is there any way to sync text data onto a tmp?
@kapa.ai This can sync multiple player names?
29 replies
NNormal
Created by stickkdoesstuff on 10/6/2024 in #🤝ask-a-question
is there any way to sync text data onto a tmp?
@kapa.ai Could i do this multiple times for each of my players names?
29 replies
NNormal
Created by stickkdoesstuff on 10/6/2024 in #🤝ask-a-question
is there any way to sync text data onto a tmp?
@kapa.ai Does tmp sync its data value when using realtime
29 replies