Zone Welcome Message
Show a local message when a player enters a trigger zone.
Category: UI Systems
UdonSharp Script
using UdonSharp;
using UnityEngine;
using TMPro;
using VRC.SDKBase;
using VRC.Udon;
public class ZoneWelcomeMessage : UdonSharpBehaviour
{
public TextMeshProUGUI messageText;
[TextArea] public string welcomeMessage = "Welcome to this area!";
public float showSeconds = 3f;
private float hideAt;
private void Update()
{
if (messageText == null) return;
if (messageText.gameObject.activeSelf && Time.time >= hideAt)
{
messageText.gameObject.SetActive(false);
}
}
public override void OnPlayerTriggerEnter(VRCPlayerApi player)
{
if (messageText == null || !player.isLocal) return;
messageText.text = welcomeMessage;
messageText.gameObject.SetActive(true);
hideAt = Time.time + showSeconds;
}
}
Setup
- Add script to trigger volume object.
- Set collider
Is Trigger. - Assign
messageTextfrom your world UI canvas.
Extra Tips and Troubleshooting
Tips and Tricks
- Keep messages short and action-oriented.
- Use different trigger zones for onboarding flow in large worlds.
Troubleshooting
- If no message appears, confirm local player trigger event and UI reference are valid.
Related Content
Prefab Setup Notes
Import the prefab or script into a throwaway test scene before adding it to a live world. Confirm inspector references, ownership behavior, sync, triggers, UI hooks, and audio or object links before moving it into the production scene.
Testing Checklist
- Test once as a local player and again with a second client or late joiner if the behavior can affect more than one player.
- Confirm ownership, sync, trigger zones, UI references, and audio or object references are assigned intentionally.
- Check desktop and VR interaction distance so players can actually use the feature in context.
- Keep a backup of the scene before changing prefabs, UdonBehaviours, or serialized references.
