For my project, I’m making “prompted interactable” scene, and I want to be able to choose which action from the Input Map will allow the user to interact with the scene. I’d like to use an exported property (@export) and have it grab the list of actions from InputMap and let me choose which of those to use. Is this possible? I don’t think it can be done with the simple @export or @export_enum but perhaps with some of the advanced exports?
Thanks, but that’s not what I need. I’ve done a bit more research and I’ve used this to get the list of actions selected -
func _get_property_list():
var actions = InputMap.get_actions()
var hint_string = ""
for action in actions:
hint_string += action + ","
var properties = []
properties.append({
"name": "prompt_action",
"type": TYPE_STRING_NAME,
"hint": PROPERTY_HINT_ENUM,
"hint_string": hint_string
})
return properties
Good News - This is getting a list of actions that I can select!
Bad News - It’s giving me the list of actions for the EDITOR, not for my game! Any ideas on how I can get the input map for the GAME I’m editing, not the EDITOR?
Fantastic! I thought that this might be what was needed, but this got everything up and running! It still had all the UI parts, so I added a check to see if the prompt began with UI as well. Thank you!