Accessing Positions on Lightship Mesh for Object Placement

  • Device type & OS version: Android / OnePlus 8T on OxygenOS 13.1
  • Host machine & OS version: Windows 11
  • Issue Environment : Unity / On Device
  • Xcode version:
  • ARDK version: 3
  • Unity version: 2022.3.0

Description of the issue:
Hi there,

I’m integrating AR Foundation’s ARRaycastManager with Lightship’s meshing for a Demo and need advice on placing objects on the Lightship-generated mesh based on user interactions.

Challenge: I’m detecting touches in the physical world using ARRaycastManager.Raycast, but I’m unsure how to translate these hits to positions on the dynamically generated Lightship mesh for accurate object instantiation.

Questions:

  • Can AR raycast hits be directly mapped to positions on a Lightship-rendered mesh? If yes, how?

  • What are the key considerations for ensuring accurate placement and good performance?

I’d appreciate any guidance or resources on this topic. Thanks!

Hello,

Unfortunately, AR Raycasts only work with trackables which meshing isn’t. Check out this link on the ARRaycastHit and also this link on ARTrackables from the Unity documentation.

What you can try is using Physics.Raycast. If you created the mesh prefab the way it’s outlined on the Meshing How To, then that method of raycasting should work since it has a mesh collider

1 Like

Hello,

thank you for response. I am already trying with normal Physics Raycasts. It is little to much work to find exact flat surface but hopefully it will work.