mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-06 16:00:08 +01:00
* These changes allow the project to start and run in Godot 4.2 I hit some of the files with my formatter, if whitespace updates are not wanted I can remove those. The project doesn't entirely work yet, but it runs. I am still working on making it work properly fully, but at least it starts now instead of crashing. * Center text to match Godot 3 example better.
20 lines
386 B
GDScript
20 lines
386 B
GDScript
extends Camera3D
|
|
|
|
@export var MOVEMENT_SPEED: float = 12
|
|
@export var flip_axis: bool = 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
|