how fix Raycast no working in scene

here my code review it
if found solve

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

public class Cyborgscrip : MonoBehaviour
{
    // Start is called before the first frame update
    public GameObject ject;
    public float lengh;
    public GameObject pos;
    private NavMeshAgent navMeshAgent;
    private Animator animator;
 
    public Vector3[] side;
    void Start()
    {
        animator = GetComponent<Animator>();
        navMeshAgent = GetComponent<NavMeshAgent>();
     
        side[0]=pos.transform.forward;
        side[1]=pos.transform.right;
        side[2]=-pos.transform.right;
    }

    // Update is called once per frame
    void racas(Vector3 pps)
    {
        Ray ra =new Ray(pos.transform.position,pps);
        RaycastHit hit;
     
        if (Physics.Raycast(ra,out hit,lengh) )
        {
            if (hit.transform.GetComponent<move>() )
            {
             
             
                    Debug.Log(hit.transform.name);
             
             
             
            }
        }
}
    void Update()
    {
     
        for(int i =0; i< side.Length ;i++)
        {
            racas(side);
        }
        navMeshAgent.SetDestination(ject.transform.position);
        animator.SetFloat("Blend",navMeshAgent.velocity.magnitude);

    }
}

First, please use code-tags when posting code. Don’t use plain-text.

Second, please put some effort into describing your problem if you want help. Dumping some text and saying it’s “not working” is not a question.

1 Like

thank very much
I’m new to forum and
take your advice