Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Aquilta |
func calculate_move_velocity(
linear_velocity: Vector2,
direction: Vector2,
speed: Vector2,
) → Vector2: ← Error is on this line
var new_velocity: = linear_velocity
new_velocity.x = speed.x * direction.x
new_velocity.y += gravity * get_physics_process_delta_time()
if direction.y == -1.0:
velocity.y = speed.y * direction.y
return speed * direction