Skip to main content
TeacherDanny
Up and Coming
March 20, 2025
Question

How do I send a string to a text gizmo? Is any one able to show me?

I've created a keyboard that types a word using a custom UI. Now I want to use the submit button to send that word to be displayed on a text gizmo. I just can't figure it out. I can't get AI to get it done but I'll keep trying. Is anyone available to show me how. I'm sure it is an easy thing for an experienced scripter.

2 replies

SeeingBlue
Honored Contributor
March 21, 2025

The Pressables have some events we can use to do something like this.

onClick()
onEnter()
onExit()
onPress()
onRelease()

Here is an article that discusses this. You could also take a look at the code from Station04-GenericYesNoDialog in the CustomUI tutorial world to get an idea of how they work.
https://developers.meta.com/horizon-worlds/learn/documentation/tutorial-worlds/custom-ui-examples-tutorial/station-4-generic-yes-no-dialog

Upcoming Events : Performance Pro - UI Unleashed - Building Responsive & Performant Interfaces Thursday June 19th 5:00 PM PT - Register June Programming Calendar
Participant
March 21, 2025

Create a prop of PropType.Entity within your UI component, then place the text gizmo into that prop. Within the UI component, you can cast the entity as a text gizmo using .as(TextGizmo), and then use .text.set() to pass in the new text string.