yumurtalıkaşar01
Hectopat
- Katılım
- 16 Şubat 2020
- Mesajlar
- 211
- Çözümler
- 1
Daha fazla
- Cinsiyet
- Erkek
- Meslek
- Öğrenci
Merhab, a ben "unity" adlı programdan oyun yapacaktım hata kodu yerinde [Assets\items\FireSystem.cs(69,6): error CS1513: } expected] yazıyor sorunlu olan metin belgesinde ben hiçbir şey göremedim hatalı eğer hata varsa yazar mısınız? Ve kontrol amaçlı hatalı olan metin belgeyi atıyorum size.
Kod:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FireSystem : MonoBehaviour.
{
RaycastHit hit;
public GameObject RayPoint;
public CharacterController Karakter;
Animator GunAnimSet;
public bool CamFire;
float gunTimer;
public float gunCooldown;
public ParticleSystem MuzzleFlash;
[Header("Oyun Sesleri")]
AudioSource SesKaynak;
public AudioClip FireSound;
public float range;
// Start is called before the first frame update.
void Start() {
SesKaynak = GetComponent<AudioSource>();
GunAnimSet = GetComponent<Animator>();
}
// Update is called once per frame.
void Update()
{
GunAnimset.SetFloat("hız", Karakter.velocity.magnitude);
if (Input.GetKey(KeyCode.Mouse0) && CamFire == true && Time.time > gunTimer) ;
{
Fire();
gunTimer = Time.time + gunCooldown;
}
void Fire()
{
if (Physics.Raycast(RayPoint.transform.position, RayPoint.transform.forward, out hit, range))
{
MuzzleFlash.Play();
SesKaynak.Play();
SesKaynak.clip = FireSound;
Debug.Log(hit.transform.name);
GunAnimSet.Play("fire", -1, 0f);
}
}
}