Skip to main content
New Participant
April 29, 2025
Question

Attachable Interactive Assets

Any hints on how to attach an interactive asset to the Player OnEnterWorld? 

My problem is that I know how to attach objects with Code Blocks, but interactive objects already have script connected to them. Is there a trick to do it? Thank you for your help! 

5 replies

SeeingBlue
Honored Contributor
April 29, 2025

Interactive objects already have scripts on them? Are these scripts that you put on them or scripts they came with? 

 

Regardless you can edit the scripts to do what you want or reference the object from another script and attach it that way. 

Are you writing in Codeblocks or typescript?

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

Thank you for reply! Just for context, I'm a designer, I understand how to make simple CodeBlock scripts, but when it comes to modifying Typescript I have no idea what I'm doing.  

 

For example, Interactive Pistol asset from public library comes with Gun script attached.  I tried getting AI help, it gave me a code that looks right, and compiled when inserted in Gun, but it doesn't do what is intended when I run the game. Code proposed by GenAI: 

PigeonNo12
Honored Contributor
May 6, 2025

The code looks right. The one thing that you might be missing is to change the configuration of the attachable object. Select the object, and in the properties go to the More category, and toggle the Avatar Attachable toggle. If you can't see this option, make sure that the object is both collidable and animated under the Behaviour category

Upcoming Events : Build with a Mentor: Custom UI Thursday 3/20 at 5:00 PM PT Register March calendar of all Mentor Workshops and Office Hours