FPS Controller
This commit is contained in:
13
demo/assets/scripts/player/components/interaction_raycast.gd
Normal file
13
demo/assets/scripts/player/components/interaction_raycast.gd
Normal file
@@ -0,0 +1,13 @@
|
||||
extends RayCast3D
|
||||
|
||||
var current_object
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if is_colliding():
|
||||
var object = get_collider()
|
||||
if object == current_object:
|
||||
return
|
||||
else:
|
||||
current_object = object
|
||||
else:
|
||||
current_object = null
|
||||
Reference in New Issue
Block a user