Unity-Technologies / arfoundation-samples

Example content for Unity projects based on AR Foundation
Other
3.07k stars 1.15k forks source link

AnchorCreator Hit doesn't have trackable property #644

Closed SonmezYigithan closed 4 years ago

SonmezYigithan commented 4 years ago

in AnchorCreator sample script line 52 I can't access hit.trackable property. I simply copy pasted the script. Deleted the loggers and SetAnchorText.

 ARAnchor CreateAnchor(in ARRaycastHit hit)
        {
            ARAnchor anchor = null;

            // If we hit a plane, try to "attach" the anchor to the plane
            if (hit.trackable is ARPlane plane)
            {
            }

Assets\Scripts\AnchorCreator.cs(50,21): error CS1061: 'ARRaycastHit' does not contain a definition for 'trackable' and no accessible extension method 'trackable' accepting a first argument of type 'ARRaycastHit' could be found (are you missing a using directive or an assembly reference?)

Unity version 2020.1.2f1 ARFoundation 3.1.6

tdmowrer commented 4 years ago

Looks like you've found the answer, but for future readers, the hit.trackable property is new in 4.1.0-preview.9 and therefore not available in earlier versions, such as 3.1.6.