How to print a value as output to vr object?

Im trying to see the realtime value of something like “player get position” printed to an object while in game, does anyone know what kind of vrc objects+script i would need?

Create a canvas with text, set the canvas to worldspace and then parent the canvas to the gameobject you’d like text on. You’ll also need to shrink it as by default the canvas will be huge. Assuming you want to get the position constantly you’d want something like this

using UnityEngine.UI

public class whatever : UdonSharpBehaviour
 {
public Text playerPos;

void Update {
playerPos.text = VRC.SDKBase.Networking.LocalPlayer.GetPosition();
}
}

Knowing what the SDK is like you might need to pass the position into a separate variable first instead of writing directly to the Text.

2 Likes