Who can help with teleport that uses raycast for 3d game(ps my script is down)

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RAYCAST : MonoBehaviour
{
public Transform Pointer;
public Transform player;
private void LateUpdate()
{
Ray ray = new Ray(transform.position, transform.forward);
Debug.DrawRay(transform.position, transform.forward * 10f, Color.red);

    RaycastHit hit;
    if (Physics.Raycast(ray, out hit)) 
    {
      Pointer.position = hit.point;
    }

    


}

}