Хотел сделать строительство по сетке. Для перемещения блока по сетке написал такой код, но он не работает:
extends Node2D
onready var _area := $Area2D
func _unhandled_input(event: InputEvent) -> void:
if event is InputEventScreenDrag:
var mouse_pos: Vector2 = get_global_mouse_position()
_area.position=Vector2(
stepify(mouse_pos.x, 128),
stepify(mouse_pos.y, 128))
-
Вопрос задан
-
226 просмотров