Raycast Guidance

I'm looking for some guidance on how to properly use Raycasting on the ML2. I was an ML1 developer and was familiar with how Raycasts worked in that system. I had developed some reusable Monobehaviors around it. When starting development on the ML2 I was looking to get started quickly, so I pulled libraries I had built for the ML1 and made the required changes (for controller, etc).

I just updated from the Unity SDK v0.53.3 to v1.0.0 and the MLRaycast and MLRaycastBehavior classes that I rely on have been removed. I can't find any documentation on migrating your Raycast behavior from ML1 to ML2. And the Unity examples that make use of Raycasts don't really explain what they are doing.

Is there documentation for this that I'm not seeing? Can you provide a walkthrough for migration so that a dev can replicate the functionality from the MLRaycast and MLRaycastBehavior classes in whatever the new classes should be?

Thanks

1 Like

Hi @rscanlo2 ,

The MLRaycast API has been deprecated. You can reference the Meshing and Plane Finding examples in the Magic Leap Unity Example project to see how to generate planes and meshes using the real world geometry. Then use the standard Physics Raycast or AR RaycastManager to raycast into the scene.

2 Likes