ARFoundation Collision between AR Camera and game objects

Hi,

Does anyone have any ideas on detecting a collision between an AR Camera/AR Session Origin and any objects that are in a game? This would be to add some sort of indicator to the app, for clarity for the users.

All the standard ways I can think of - such as adding a character controller to the AR Camera and using collisions between than and any other 3D Game Object (with collider and rigidbody) doesn’t seem to be working - unless I’ve missed something!

Something like this.

Hi,

I use a capsule collider on ARCamera component. And use colliders as trigger on the others objects to detect collision.

I think it’s not the best, but it’s work.

Best,
Alexis

That makes sense - the problem I now keep coming up against is that the collider on the ARCanmera component keeps detecting collisions with the ARPlane prefab - any workaround? As I want to have the trigger on the ARCamera so that it plays audio/does some visual stuff every time you collide with anything (except the Plane!)

You can used different Layer on Plane and ARCamera.

And disable physics between them in Project Settings → Physics

Try this:

Hey do you found some solution for this?
I am facing the same issue .
Please can you help

To do that, you need to attach a Collider and a RigidBody on the ARCamera.

If you have a problem with the ARCamera rotation. Create an empty GameObject, attach the Collider and the RigidBody and update the position base on the ARCamera position.

Best,
Alexis