Godot Version
godot 4
Question
this script created raycast(and all others I’ve tried) return the following error when trying to access the position field of the created dictionary.
“Invalid get index ‘(121.5854, -12.69985, 15.1143)’ (on base: ‘Dictionary’).”
what am I doing wrong?
here’s my script
var space_state = get_world_3d().direct_space_state
var query = PhysicsRayQueryParameters3D.create(pathPoints[pi].position, targetNearest.position)
var result = space_state.intersect_ray(query)
# this is the error
if child.position.distance_to(result[position]) < curDistance: