mirror of
https://codeberg.org/ProgramSnail/konkr_game_3d.git
synced 2026-01-02 19:58:15 +00:00
init
This commit is contained in:
commit
5408d75267
2834 changed files with 377523 additions and 0 deletions
12
scripts/Cursor.gd
Normal file
12
scripts/Cursor.gd
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
extends MeshInstance
|
||||
|
||||
onready var camera : Camera = get_node("/root/Level/Camera")
|
||||
|
||||
func _physics_process(_delta):
|
||||
var position_2d = get_viewport().get_mouse_position()
|
||||
var drop_plane = Plane(Vector3(0, 1, 0), 1)
|
||||
var position_3d = drop_plane.intersects_ray(
|
||||
camera.project_ray_origin(position_2d),
|
||||
camera.project_ray_normal(position_2d))
|
||||
|
||||
translation = position_3d
|
||||
Loading…
Add table
Add a link
Reference in a new issue