Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How do I fix this code?

I am using the "Shooting with Raycasts" tutorial. my code looks like this:

using UnityEngine;

public class Gun_Script : MonoBehaviour

{

  public float damage = 10;

  public float range = 100f;


  public Camera fpsCam;

  // Update is called once per frame

  void Update()

  {

    if (Input.GetButtonDown("Fire1"))

      {

      Shoot();

    }

  }


  void Shoot()

  {

    RaycastHit hit;

   if (Pysics.Raycast(fpsCam.transform.position, fpsCam.transform.forward, out hit))

    {

      Debug.Log(hit.transform.name);

    }

  }

}

I am getting an error that is shown in the attached photo. What am I doing wrong and how do I fix it?


Sign In or Register to comment.