added machine item slots so ican start building gameplay
This commit is contained in:
21
GameShit/PlayerController/ControllerSystem/Highlight.gd
Normal file
21
GameShit/PlayerController/ControllerSystem/Highlight.gd
Normal file
@@ -0,0 +1,21 @@
|
||||
extends RayCast3D
|
||||
|
||||
# Keep track of what we were just looking at
|
||||
var current_target: Object = null
|
||||
|
||||
func _physics_process(_delta: float) -> void:
|
||||
if is_colliding():
|
||||
var collider = get_collider()
|
||||
if current_target != collider:
|
||||
_clear_current_highlight()
|
||||
current_target = collider
|
||||
if current_target.has_method("startHighlight"):
|
||||
current_target.startHighlight()
|
||||
else:
|
||||
_clear_current_highlight()
|
||||
|
||||
func _clear_current_highlight() -> void:
|
||||
if current_target != null:
|
||||
if current_target.has_method("stopHighlight"):
|
||||
current_target.stopHighlight()
|
||||
current_target = null
|
||||
Reference in New Issue
Block a user