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
    • Example Projects
    • Scripts
    • Shaders
    • Unity Tutorials
    • FPS Kit Tutorials
    • 3D models
    • Animated 3D Models
    • Graphic design
    • Textures
    • Sounds
    • Other
  • SELL | REQUEST
    • Sell
    • Request
  • Mars' Modular Multiplayer Photon FPS Kit's Topics
  • Mars' Modular Multiplayer Photon FPS Kit's Reviews
  • Mars' Modular Multiplayer Photon FPS Kit's Updates
  • Mars' Modular Multiplayer Photon FPS Kit's Tutorials
  • Busy People's Introductions
  • Photon's Tutorials
  • Photon's Photon General
  • Photon's Showcase

Categories

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

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


YouTube URL


Facebook URL


Twitter URL


IndieGoGo URL


Kickstarter URL


IndieDB URL


GreenLight URL


Location:


Interests

Found 2 results

  1. 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
  2. Ziggs

    Missing Refrence

    Hello! I have a problem. i'm using Photon Unity Networking for a multiplayer fps game. i have made an empty object and added a new script for connecting and spawning. after i finshed coding i tried running the game but i get two yellow errors saying "The refrenced script on this Behaviour is missing!" i'm using unity 5 and i'm follownig this tutorial https://www.youtube.com/watch?v=mLAilMkRxYU&index=4&list=PLbghT7MmckI7BDIGqNl_TgizCpJiXy0n9 This is my code: using UnityEngine; using System.Collections; public class NetworkManager : MonoBehaviour { public Camera standbyCamera; // Use this for initialization void Start () { Connect (); } void Connect() { PhotonNetwork.ConnectUsingSettings( "MultiFPS v001" ); } void OnGUI() { GUILayout.Label( PhotonNetwork.connectionStateDetailed.ToString() ); } void OnJoinedLobby() { Debug.Log ("OnJoinedLobby"); PhotonNetwork.JoinRandomRoom(); } void OnPhotonRandomJoinFailed() { Debug.Log ("OnPhotonRandomJoinFailed"); PhotonNetwork.CreateRoom( null ); } void OnJoinedRoom() { Debug.Log ("OnJoinedRoom"); SpawnMyPlayer(); } void SpawnMyPlayer() { PhotonNetwork.Instantiate("PlayerController", Vector3.zero, Quaternion.identity, 0); standbyCamera.enabled = false; } } Thanks for your help!
×
×
  • Create New...