ARCursorRenderer.cs with realtime meshing?

Include the following details (edit as applicable):

  • Issue category: Unity Example Package
  • Device type & OS version: iPhone XS, iOS 16.1.1
  • Host machine & OS version: Mac
  • Issue Environment : Unity Remote / Unity Mock / On Device / Dev Portal
  • Xcode version: 14.2
  • ARDK version:2.4.2
  • Unity version: 2021.3.8f1

Description of the issue: I’d like to know how can I update the ARCursorRenderer.cs script to work with real time meshing, and not plane detection. It seems that the hitTestResults only work with planes and not meshes. My goal is to map the environment around the user, and then he visualizes an object in front of the camera that moves on the detected surface(meshes), and when you tap, the object is released and doesn’t move anymore (it always follow the cursor just like the ARCursorRenderer.cs, but it needs to work with meshing, and when tap it stops following the cursor and stays on the last position).

Hello Marcus,

Unfortunately hit testing wouldn’t be an option since it’s a wrapper around the ARCore/Kit implementation which hit tests planes. However, you can try attaching a mesh collider to the Mesh Chunks of the ARMesh and do a raycast into the layer that the ARMesh/Mesh Chunks are in.

The cursor renderer isn’t necessarily a part of ARDK, it was included to aid in some tutorials and it can be edited by users. You can adapt it to use raycasts instead of hit tests or (if you want to keep it as is to follow along with tutorials) you can create your own script that renders a cursor as well