
It looks like you're new here. If you want to get involved, click one of these buttons!
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?
Answers
ur code is good but u need to type physics whit "h"
hope u get it
lol physics spelling is wrong