Generation

generate functionMon, 05 Dec 2022

attach a tooltip to the object with the text "Follow me!" always facing the player

public void SetToolTip(VRTK_InteractableObject obj, string text) { var tip = obj.GetComponentInChildren<VRTK_ObjectTooltip>(); if (tip == null) { tip = obj.gameObject.AddComponent<VRTK_ObjectTooltip>(); } tip.displayText = text; tip.textAlignment = TextAlignmentOptions.Center; tip.alwaysFaceHeadset = true; tip.useTipsMesh = true; }

Want to kickstart your project?Use the new AI Studio to create your code