4 bugs wont fix! (please notice it wont fix at all!)

i have 4 bugs wont fix at all, im trying to fix but it never fixes!!

please can someone tell me how to fix it or any solution please?!

the first bug, character animation script doesnt work, only idle animation works.

the second bug player damage, explosiveDamage and boneDamage doesnt work, only ApplyDamage works.

third bug, it also happens with character animation, weapon wont change and weapon sync wont work, i think because of character animation.

fourth bug, smooth movement is not working.

Comments

  • edited November 2019
    please help!
  • help please!
  • edited December 2019
    yet nobody is responding and i have this error hotonView with ID 1001 has no method "BoneDamage" marked with the [PunRPC](C#) or @PunRPC(JS) property! Args: Single, PhotonPlayer, video for proof that nothing works correctly... https://youtu.be/NKB4IxHy6E8
  • edited December 2019
    scripts:

    using System.Collections;
    using UnityEngine;

    [RequireComponent(typeof(AudioSource))]
    public class WeaponSync : MonoBehaviour
    {
    public WeaponScript firstPersonWeapon;

    public Transform firePoint;

    public GameObject bullet;

    public Renderer muzzleFlash;

    public Rigidbody projectile;

    public AudioClip fireAudio;

    private void Start()
    {
    if ((bool)muzzleFlash)
    {
    muzzleFlash.GetComponent().enabled = false;
    }
    GetComponent().playOnAwake = false;
    if (!firstPersonWeapon)
    {
    return;
    }
    if (firstPersonWeapon.GunType == WeaponScript.gunType.MACHINE_GUN)
    {
    if ((bool)firstPersonWeapon.machineGun.bullet)
    {
    bullet = firstPersonWeapon.machineGun.bullet.gameObject;
    }
    if ((bool)firstPersonWeapon.machineGun.fireSound)
    {
    fireAudio = firstPersonWeapon.machineGun.fireSound;
    }
    }
    if (firstPersonWeapon.GunType == WeaponScript.gunType.SHOTGUN)
    {
    if ((bool)firstPersonWeapon.ShotGun.bullet)
    {
    bullet = firstPersonWeapon.ShotGun.bullet.gameObject;
    }
    if ((bool)firstPersonWeapon.ShotGun.fireSound)
    {
    fireAudio = firstPersonWeapon.ShotGun.fireSound;
    }
    }
    if (firstPersonWeapon.GunType == WeaponScript.gunType.GRENADE_LAUNCHER)
    {
    if ((bool)firstPersonWeapon.grenadeLauncher.projectile)
    {
    projectile = firstPersonWeapon.grenadeLauncher.projectile;
    }
    if ((bool)firstPersonWeapon.grenadeLauncher.fireSound)
    {
    fireAudio = firstPersonWeapon.grenadeLauncher.fireSound;
    }
    }
    if (firstPersonWeapon.GunType == WeaponScript.gunType.KNIFE && (bool)firstPersonWeapon.knife.fireSound)
    {
    fireAudio = firstPersonWeapon.knife.fireSound;
    }
    }

    private void syncMachineGun(float errorAngle)
    {
    StopAllCoroutines();
    StartCoroutine(machineGunShot(errorAngle));
    }

    private IEnumerator machineGunShot(float errorAngle)
    {
    Quaternion oldRotation = firePoint.rotation;
    firePoint.rotation = Quaternion.Euler(UnityEngine.Random.insideUnitSphere * errorAngle) * firePoint.rotation;
    GameObject instantiatedBullet = UnityEngine.Object.Instantiate(bullet, firePoint.position, firePoint.rotation);
    instantiatedBullet.GetComponent().doDamage = false;
    firePoint.rotation = oldRotation;
    GetComponent().clip = fireAudio;
    GetComponent().Play();
    if ((bool)muzzleFlash)
    {
    muzzleFlash.GetComponent().enabled = true;
    yield return new WaitForSeconds(0.04f);
    muzzleFlash.GetComponent().enabled = false;
    }
    }

    private void syncShotGun(float fractions)
    {
    StopAllCoroutines();
    StartCoroutine(shotGunShot(fractions));
    }

    private IEnumerator shotGunShot(float fractions)
    {
    for (int i = 0; i < (int)fractions; i++)
    {
    Quaternion rotation = firePoint.rotation;
    firePoint.rotation = Quaternion.Euler(UnityEngine.Random.insideUnitSphere * 3f) * firePoint.rotation;
    GameObject gameObject = UnityEngine.Object.Instantiate(bullet, firePoint.position, firePoint.rotation);
    gameObject.GetComponent().doDamage = false;
    firePoint.rotation = rotation;
    }
    GetComponent().clip = fireAudio;
    GetComponent().Play();
    if ((bool)muzzleFlash)
    {
    muzzleFlash.GetComponent().enabled = true;
    yield return new WaitForSeconds(0.04f);
    muzzleFlash.GetComponent().enabled = false;
    }
    }

    private void syncGrenadeLauncher(float initialSpeed)
    {
    grenadeLauncherShot(initialSpeed);
    }

    private void grenadeLauncherShot(float initialSpeed)
    {
    Rigidbody rigidbody = UnityEngine.Object.Instantiate(projectile, firePoint.position, firePoint.rotation);
    rigidbody.GetComponent().isRemote = true;
    rigidbody.AddForce(rigidbody.transform.forward * initialSpeed * 50f);
    Physics.IgnoreCollision(rigidbody.GetComponent(), base.transform.root.GetComponent());
    Collider[] componentsInChildren = base.transform.root.GetComponentsInChildren();
    foreach (Collider collider in componentsInChildren)
    {
    Physics.IgnoreCollision(rigidbody.GetComponent(), collider);
    }
    GetComponent().clip = fireAudio;
    GetComponent().Play();
    }

    private void syncKnife(float temp)
    {
    knifeOneHit();
    }

    private void knifeOneHit()
    {
    GetComponent().clip = fireAudio;
    GetComponent().Play();
    }
    }

  • Closing this, as you opened another thread for the topic.
This discussion has been closed.