Open kdada opened 2 years ago
Please attach the minimal reproduction project.
@rburing I uploaded the minimal reproduction project.
If you create the separation ray shape once instead of re-creating it every frame, then it works:
var ray_rid: RID
func _enter_tree():
ray_rid = PhysicsServer3D.separation_ray_shape_create()
PhysicsServer3D.shape_set_data(ray_rid, {
"length": 1,
})
func _exit_tree():
PhysicsServer3D.free_rid(ray_rid)
Still we should investigate why your way didn't work.
@rburing Thanks for your solution. It works!
We're still getting this issue on Godot 4.3 RC1, it appears to be the only thing stopping us from enabling threaded physics. We're using a ShapeCast3D node instead of intersect_shape however.
Godot version
4.0.beta.custom_build [dc4b61659]
System information
Windows 11, Vulkan
Issue description
I want to check all obstructions between 2 players. But the code only works properly when 'physics/3d/run_on_seperate_thread' is off. When it on, intersect_shape sometimes returns correct dictionaries and sometimes returns an empty array.
My Scene: A plane with 2 RigidBody3D [Sphere] and 1 StaticBody3D [Box]. Place the StaticBody3D between the 2 RigidBody3D.
Steps:
Code:
When I run it with 'physics/3d/run_on_seperate_thread' disabled, all checks are correct:
When I run it with 'physics/3d/run_on_seperate_thread' enabled, some checks returns [].
Steps to reproduce
See Issue description
Minimal reproduction project
study-godot-67478.zip