Виктория Зяблицева
Ученик
(125)
6 месяцев назад
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Gun : MonoBehaviour
{
public float damage = 21;
public float fireRate = 1;
public float range = 15;
public GameObject muzzleFlash;
public AudioClip shotSFX;
public AudioSourse _audioSourse;
public Camera _cam;
// Update is called once per frame
void Update()
{
if (Input.GetButtonDown("Fire1"))
{
Shoot();
{
{
void Shoot()
{
RaycastHit hitt;
if (Physics.Raycast(_cam.transform.position,_cam.transform.forward,out hit,range))
{
Debug.Logs("Пиу Пиу я попал");
{
{
{
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Gun : MonoBehaviour
{
public float damage = 21;
public float fireRate = 1;
public float range = 15;
public GameObject muzzleFlash;
public AudioClip shotSFX;
public AudioSourse _audioSourse;
public Camera _cam;
// Update is called once per frame
void Update()
{
if (Input.GetButtonDown("Fire1"))
{
Shoot();
}
}
void Shoot()
{
RaycastHit hit;
if (Physics.Raycast(_cam.transform.position,_cam.transform.forward,out hit,range))
{
Debug.Log("Пиу Пиу я попал");
}
}
}