Forum Discussion

LadyMo218's avatar
LadyMo218
Member
10 months ago

Actions for Grabbable Items - Desktop / Mobile Mode

When you have a grabbable item such as a weapon, how would I use codeblock scripting to assign the action? The only key on desktop that works with the item automatically is the X for dropping the item and E to pick it up. What about swinging the bat, or if its a gun shooting it? Or is this something you can only do in typescript?

X_Elias_X 

7 Replies

  • Looks like there should be a way to make this bat swing. In the Actions tab scroll down to the HWXS section and you will see this code block. There are only a few options available, but as long as you have the grip pose configured as sword in the properties panel setting the string to "Fire" should work. This string is case sensitive.

     

  • Most of the cross screen custom input configuration needs to be done via typescript. You have a lot of control from TS over intercepting events, setting their on-screen-icon, etc.  In codeblocks, it's much more limited. But you can set the grip pose type (pistol, sword, rifle, etc) via the property panel.  And as proto_xr says, you can force the player to do a pose animation (e.g. fire, reload, etc) via codeblocks.

    • starpool108's avatar
      starpool108
      Member

      Would I be able to set up the mobile primary icon to grab and put on a hat? The closest option I see is "use". I am also trying to set up a mobile icon for a grab object that has a flying script. I am a beginner with codeblocks. 

       

  • When looking at a grabbable object's More properties you will noticed a Primary Action Icon, Secondary Action Icon, and a Tertiary Action Icon. By default they have nothing selected in their dropdown and show up on the screen like you've shown. If you at least set the ones you're not using to None, then the icons will not appear.

    • Cercatore's avatar
      Cercatore
      Member

      Thanks for that, they'er not clickable so I was wondering what those were. It removed everything but the down arrow with the x

  • You can go into the property panel to set the various poses.  I would also go to the mobile examples world to see what each pose looks like compared to what it is called in the property panel