Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | chunkymilkyo |
Hey all, I’m still learning Godot. But I’m trying to see how I can start a dialogic node when the player is in the Area2d collision. So far, i can only get a mouse click to work but I don’t know how to do with when player is close by and trigger it by a key on the keyboard
Here’s my current code:
`extends Area2D
func _ready():
pass # Replace with function body.
func _on_YoMama_input_event(viewport, event, shape_idx):
if event is InputEventKey:
if event.pressed and event.scancode == KEY_ESCAPE:
var dialog = Dialogic.start(“convoWithKitty”)
add_child(dialog)
`
thanks again!
Try formatting your code with the { } icon so that its readable. It will be easier to find help that way.
magicalogic | 2021-05-12 05:05