dynamic_water_2d/examples/dynamic_water/example.gd
2024-08-19 13:56:56 +03:00

12 lines
299 B
GDScript

@tool
extends Node2D
@onready var water: DynamicWater2D = $Water
func _process(_delta: float) -> void:
var mouse_coords := water.get_global_mouse_position()
# apply 128 units of downwards force on mouse position in a 48 unit radius
water.apply_force(mouse_coords, 128.0 * Vector2.DOWN, 48.0)