import { defineScript } from "@mini2d/core"; export default defineScript({ fixedUpdate({ node, input }, dt) { const x = input.axis1D("move_x"); const y = input.axis1D("move_y"); const length = Math.max(1, Math.hypot(x, y)); const speed = 200; node.position.x += (x / length) * speed * dt; node.position.y += (y / length) * speed * dt; }, });