mirror of
https://github.com/Relintai/pandemonium_demo_projects.git
synced 2024-12-21 13:56:50 +01:00
18 lines
374 B
GDScript3
18 lines
374 B
GDScript3
|
extends Camera
|
||
|
|
||
|
export(float) var MOVEMENT_SPEED = 12
|
||
|
export(bool) var flip_axis = false
|
||
|
|
||
|
onready var targets = $Targets
|
||
|
|
||
|
|
||
|
func _process(_delta):
|
||
|
var mouse_to_world = project_local_ray_normal(get_viewport().get_mouse_position()) * MOVEMENT_SPEED
|
||
|
|
||
|
if flip_axis:
|
||
|
mouse_to_world = -mouse_to_world
|
||
|
else:
|
||
|
mouse_to_world.z *= -1
|
||
|
|
||
|
targets.transform.origin = mouse_to_world
|