Godot Version
Godot v4.3.stable - Debian GNU/Linux 12 (bookworm) 12 - Wayland - Vulkan (Forward+) - (software emulation on CPU) llvmpipe (LLVM 15.0.6, 256 bits) - AMD Ryzen 3 7320C with Radeon Graphics (8 Threads)
Question
I have a CharacterBody2D with a RayCast as a child, and I want to have a function that sets the raycast’s target position to another global position and returns where it collides along the way. I’ve tried doing that with
func target_collision_point(target: Vector2) -> Vector2:
self.target_position = self.global_position - target
self.force_raycast_update()
return self.get_collision_point()
but it doesn’t work and set it to a very far away position, not even in the correct direction.