For my 3d game on Godot 4.1, I want to create a dialogue and move to the next level when touching the trigger zone. Can you tell me how to do this?
The bottom line is that the player approaches the table (where the trigger is placed) and a dialog box opens, after which he goes to the door and selects the enter button in the menu, after which he is transferred to another level.
Player code
func _ready():
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
func _input(event: InputEvent): #повороты мышкой
if Input.is_action_just_pressed("ui_cancel"):
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
if event is InputEventMouseMotion:
head.rotate_y(-event.relative.x * sens)
cam.rotate_x(-event.relative.y * sens)
cam.rotation.x = clamp(cam.rotation.x,deg_to_rad(-89),deg_to_rad(89))
Тимофей Гаврилов is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.