Skip to main content
LadyMo218
Up and Coming
March 1, 2025
Question

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

protoxr1487653
Honored Contributor
March 1, 2025

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.

 

Proto_XR
LadyMo218
LadyMo218Author
Up and Coming
March 2, 2025

 thanks! this makes sense. X_Elias_X - try this

Shards632
Honored Contributor
March 2, 2025

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.

June Programming Calendar
Participant
April 23, 2025

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. 

 

SeeingBlue
Honored Contributor
March 3, 2025

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.

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

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

UtterlyOtter
Up and Coming
March 3, 2025

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