Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | voidzeu |
video: 2022-11-05 02-49-48
Raycast wont update immediatly when it’s not pointing at the object/pointing at the object
extends Node3D
func _process(delta):
var get_collider = $Player/Head/Camera3d/RayCast3d.get_collider()
if $Player/Head/Camera3d/RayCast3d.is_colliding():
if get_collider == $block:
$Player/Head/Camera3d/looking_at.text = "looking at: block"
else:
$Player/Head/Camera3d/looking_at.text = "looking at: nothing"