Hi, I’m working on a game and I’m using several Area3D instances to define the target location. These Area3D instances are made from a template that has a CollisionShape3D shaped like a SeparationRayShape3D. When I run the game, this error shows up 8 times:
W 0:00:06:0148 solve_static: Collisions between rays are not supported.
<C++ Source> servers/physics_3d/godot_collision_solver_3d.cpp:397 @ solve_static()
Do you have any idea what the reason is and how it can be solved?
A 3D ray shape, intended for use in physics. Usually used to provide a shape for a CollisionShape3D. When a SeparationRayShape3D collides with an object, it tries to separate itself from it by moving its endpoint to the collision point. For example, a SeparationRayShape3D next to a character can allow it to instantly move up when touching stairs. SeparationRayShape3D — Godot Engine (stable) documentation in English
Without knowing anything more about your scene, I can only assume you’re trying to cast a ray against them, which makes sense if they are targets.
My question is: Why are you using a SeparationRayShape3D as the shape of a target location? Seems like you need to use a different template.
I’m using it because I have a box of Area3D that trigger like the pixels of a sensor. I might be able to use something else, but since I needed something like a ray, this was the option I chose.
Another point is that I’m not colliding two SeparationRayShape3D together; they collide separately with other objects (CharacterBody3D with a CollisionShape3D with a BoxShape3D). That’s why I’m not sure why I’m getting this warning.
You say that you’re not colliding two SeparationRayShape3D together, but if you check the source code that emits the warning:
It is clear that the two shapes that are colliding are both of the SHAPE_SEPARATION_RAY type. Can you check that their collision mask is different then their collision layer and are not colliding with each other?
I read your explanation of why you use the SeparationRayShape3D but it has a specific use case that does not align with your implementation. I still recommend using a different shape, even if that means changing the template. Maybe if you share more about what this box of area3d triggers looks like and their tree structure, it may make more sense.
Yes, I checked the source as well and came to the same conclusion. I worked on it for a while and realized that this warning doesn’t show up in the reference scene (where the sensors are cloned), but when I run the game in the main scene (which has a sample of the reference scene), the warning appears 8 times. I changed the number of sensors, but no matter how many I have, the warning still shows up 8 times.
main scene tree:
reference scene tree (I checked out RigidBody3D, it doesn’t have any effect.):
What happens when you first set the $Instances/Area3D/CollisionShape3D.disabled = true
Right below the ready function. In fact, set it as disabled in the editor
Then duplicate your Area3D and set the duplicate’s position and then set the duplicate’s collisionshape3d.disabled to false.
It could be that one collisionshape collides 8 times. To narrow it down further, try disabling as much collisionshapes until the error doesn’t show up.
I work on it a bit more, the reason the errors kept repeating was that when the number of sensors increased there was a short delay in positioning the sensors causing the signal to be sent before the position was changed, this was only for 8 It finally happens.
I implemented your idea, disabled the instance and enabled the copied sensors one by one and the warnings went away.