Forum Discussion

5 Replies

  • 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?

    • PavlovanXR's avatar
      PavlovanXR
      Partner

      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's avatar
        PigeonNo12
        Mentor

        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