Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

Search the Community

Showing results for tags 'missing'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GENERAL
    • Introduce yourself
    • Discussions
    • Showcase
    • Need help?
    • Seeking team members?
    • Offtopic
  • RESOURCES
    • unity3D | Example Projects
    • unity3D | Scripts
    • unity3D | Shaders
    • unity3D | Tutorials
    • 3D models
    • Animated 3D Models
    • Graphic design
    • Textures
    • Sounds
    • Other
  • FREE FPS PROJECT
    • FPSKit Download
    • FPSKit Modifications/Tutorials
    • FPSKit WIP/Showcase
    • Discussions / Bug reports
  • SELL | REQUEST
    • Sell
    • Request
  • Photon's Tutorials
  • Busy People's Introductions
  • Mars' Modular Multiplayer Photon FPS Kit's Topics
  • Mars' Modular Multiplayer Photon FPS Kit's Reviews
  • Photon's Photon General
  • Photon's Showcase
  • Mars' Modular Multiplayer Photon FPS Kit's Updates

Categories

  • Free Projects
  • Free Assets
  • Game Demos
  • Photon's Files

Calendars

  • Community Calendar

Facebook URL


Twitter URL


IndieGoGo URL


Kickstarter URL


IndieDB URL


GreenLight URL


Location:


Interests

Found 1 result

  1. Strange Bug, help me pls

    So i am new to unity and i found this FPS-Kit to be really usefull. Sadly i runned into a strange bug that i got rid of but i do not know why. I added some Zombies into the Kit. Then i added Colliders to all bullets to make the Zombies die when get hit. My ZombieScript: ------------------------------------------------------------------------------------------------------- var target: Transform; var health:float = 90; var navComponent: UnityEngine.AI.NavMeshAgent; var anim: Animator; var followDistance: float; // the distance in which to follow the player var minDistance: float; var attackDistance: float; var deadd: int = 0; private var healthScript: HealthScript; function Start() { target = GameObject.FindWithTag("Player").transform; navComponent = this.transform.GetComponent(UnityEngine.AI.NavMeshAgent); anim = GetComponent("Animator"); anim.SetBool("Attack", false); } function Update() { if (deadd == 0){ if (target) { var distanceToTarget = Vector3.Distance(transform.position, target.transform.position); if (distanceToTarget <= followDistance) { if (distanceToTarget <= attackDistance) { anim.SetBool("Attack", true); } else { anim.SetBool("Attack", false); } if (distanceToTarget >= minDistance) { anim.SetBool("Stay", false); navComponent.Resume(); navComponent.SetDestination(target.position); anim.SetFloat("speed", 1); }else { navComponent.Stop(); } } else { anim.SetBool("Stay", true); navComponent.Stop(); } } } } function OnTriggerEnter (col: Collider) { if (col.gameObject.tag == "Projectile") { deadd = 69; navComponent.Stop(); yield WaitForSeconds(0.1); anim.SetBool("Die", true); yield WaitForSeconds(1.12); Destroy(gameObject); } if (col.gameObject.tag == "Player") { healthScript = gameObject.Find("Player").GetComponent(HealthScript); healthScript.Die(); } } -------------------------------------------------------------------------------------------------------- Working fine like 90% of the time. But sometimes after i hit a Zombie the game "Pauses" and i get the following error: MissingReferenceException: The object of type 'SphereCollider' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object. ZombieBH+$OnTriggerEnter$69+$.MoveNext () (at Assets/ZombieBH.js:74) UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17) After that i can hit the Pause Button and the game goes on. I only testet this on my m4. I don't use the other weapons in the game atm beside the rpg. Not sure if that happens on rpg too, could not reproduce it as fast as on the m4. I added a "Sphere Collider" on my particle_body as as far as i know this is the part that hits the zombie first. I did not modyfiy the Destroy After Script. But i added colliders to a lot of things to test what exactly kills my zombie. Perhaps i forgot to remove a collider from one object but i could not find anything else with a collider beside particle_untagged. --- I removed the collider from the particle_untagged and as for now the bug stopped to appear. Was the Collider at particle_untagged the reason for my bug? And why? I didn't noticed that when i fire a weapon a particle_untagged appears in my Hierarchy. So i thought this does not have an impact? I'd love to know if this was the reason for my Bug, and if i can improve my Zombie Script. Sorry for my really bad englisch, i am from Germany. Anyway, thank you
×