XRToolsFunctionPointer not reporting area it collides with

Godot Version

4.2.2

Question

I’m using XRTools Plugin for Godot 4.2.2. I can see that the pointer collides with an Area3D after I enable it because the laser pointer stops at the Are3D as expected:

function_pointer.set_collide_with_areas(true)

But when I check to see the last position it collided with it’s either (0,0,0) or a point in the far distance. It never reports the location of the area 3d it collides with even though I can clearly see it’s colliding due to the laser stopping at the target! Is this a known bug?

node3d.global_position = function_pointer.last_collided_at
print("Pointer Emit: ", function_pointer.last_collided_at, " - ", function_pointer.last_target)

EDIT: It doesn’t report correctly for StaticBody3D either.

After enabling Debugging collision shapes I see that the pointer is not colliding with the Area3D. I have had to add my Sprite3D to an XR Tools viewport 2d in 3d. Now I see the collision happening. But I’m not seeing my sprite3D in the viewport anymore, just the hitbox of the 2d viewport in 3d .

@jbizlv hard to see what you’re doing wrong here, I think with the scenario you’re using a Viewport2Din3D you’re just seeing the collision with the viewport , that likely doesn’t relate to what you’re trying to do.

Colliding with areas should be supported just fine with the pointer. I’m guessing you’ve got your collision masks setup incorrect as the pointer by default only works on certain collision layers.

Apologies for taking so long to respond. I solved my problem & figured It’s easier to show what I was trying to do. But I wasn’t quite close enough to show at the time.

Yes you were correct the pointer was not interacting with the objects due to collision layer. After fixing this the game became to easy. You would always hit the target, it was near impossible to miss and made the game less fun. I wanted to add some type of ability to miss. So I threw it in a 2d in 3d view port, which allowed the user to “attack” and still be able to miss, because they were hitting the 2d viewport not the collision shape. This gave the ability to miss the target sometimes, which is what I was intending. This introduced a whole new set of issues to deal with regarding the pointer, but I resolved them all relatively easily

It is kind of a strange use case I guess, but I made it work like I intended.

The WebXR beta demo of my game can be found here: