coding help

i used this code for AR camera in version 2.1 but some script is change so plz. help me to correct this

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.ARFoundation;

public class PlaceOnPlane : MonoBehaviour {

private ARSessionOrigin sessionOrigin;
private List hits;

public GameObject model;
public GameObject canvas;
// Start is called before the first frame update
void Start() {
sessionOrigin = GetComponent();
hits = new List();
model.SetActive(false);
canvas.SetActive(false);
}

// Update is called once per frame
void Update() {
if (Input.touchCount == 0)
return;
Touch touch = Input.GetTouch(0);
if (sessionOrigin.Raycast(touch.postion, hits, UnityEngine.Experimental.XR.TrackableType.PlaneWithPolygon))
{
Pose pose = hits[0].pose;
if (!model.activeInHierarchy)
{
model.SetActive(true);
model.transform.position = pose.position;
model.transform.rotation = pose.rotation;

canvas.SetActive(true);

}
else
{
model.transform.position = pose.position;
}
}
}
}

Hey there, the raycast method is no longer within the ARSessionOrigin, it was moved to a different class ARRaycastManager.

using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.ARFoundation;
using UnityEngine.XR.ARSubsystems;

private ARRaycastManager    ARRaycast   = null;
private List<ARRaycastHit>  arHits      = null;

private Pose pose = Pose.identity;

void Start()
{
    this.ARRaycast = this.GetComponent<ARRaycastManager>();
    this.arHits = new List<ARRaycastHit>();
}

public void Update()
{
    Ray ray = this._camera.ScreenPointToRay(new Vector3(Screen.width / 2, Screen.height / 2, 0f));

    this.arHits = new List<ARRaycastHit>();

    if (this.ARRaycast.Raycast(ray, this.arHits, TrackableType.PlaneWithinPolygon))
    {
        this.pose = this.arHits[0].pose;
    }
}

.

can i use this script for AR Camer