added building mode for cart
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
extends Camera3D
|
||||
|
||||
@export var rayLength: float
|
||||
func getGlobalMousePosition() -> Vector3:
|
||||
|
||||
var debugLabel
|
||||
func _ready() -> void:
|
||||
debugLabel = $DebugLabel1
|
||||
|
||||
func getGlobalRayTargetObject():
|
||||
var space = get_world_3d().direct_space_state
|
||||
var mousePos = get_viewport().get_mouse_position()
|
||||
var from = self.project_ray_origin(mousePos)
|
||||
var to = from + self.project_ray_normal(mousePos) * rayLength
|
||||
var query = PhysicsRayQueryParameters3D.create(from,to)
|
||||
var collison = space.intersect_ray(query)
|
||||
return collison.position
|
||||
return collison
|
||||
|
||||
Reference in New Issue
Block a user