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.

anarko67

Newbie
  • Content Count

    17
  • Joined

  • Last visited

Community Reputation

9 Neutral

6 Followers

About anarko67

  • Rank
    Newbie
  • Birthday 12/19/1986

Profile Information

  • Gender
    Male
  • Location:
    France
  1. New test (translate CS) the oma "Wehicle" script. But its the same problem. NullReferenceException: Object reference not set to an instance of an object Vehicl.Start () (at Assets/Car/Scripts/CSharpScripts/Vehicl.cs:31) GameObject pl = GameObject.Find(PhotonNetwork.playerName+photonView.owner); The probleme is the player name. Please help me . " invokplayernetwork.cs , have source code for the palyer name. " gameObject.name = gameObject.name + photonView.owner ; "Vehicl.cs" using UnityEngine; using System.Collections; //Script made by OMA [www.armedunity.com] public class Vehicl : Photon.MonoBehaviour { GameObject weaponCamera; // drag and drop pl camera from Hierarchy to Inspector window! public GameObject vehicleCam; Transform vehicleCameraTarget; GameObject vehicle; GameObject pl; Transform GetOutPosition; // Empty game object, where pl will get out of the vehicle bool VehicleControllScript; // Just write script name, which controls vehicle movement (controller script). private bool opened = false; private float waitTime = 1; // leave it as 1 private bool temp = false; private GameObject mainCamera; string SoundController = "SoundController"; // Just write script name, which controls vehicle movement (controller script). void Awake(){ GameObject vehicle = GameObject.Find("Car"); ; GameObject pl = GameObject.Find(PhotonNetwork.playerName+photonView.owner); mainCamera = GameObject.FindWithTag("MainCamera"); weaponCamera = GameObject.FindWithTag("WeaponCamera"); vehicle = GameObject.FindWithTag("Car"); vehicleCam = GameObject.FindWithTag("CamCar"); } void Start (){ GameObject pl = GameObject.Find(PhotonNetwork.playerName+photonView.owner); mainCamera = GameObject.FindWithTag("MainCamera"); weaponCamera = GameObject.FindWithTag("WeaponCamera"); vehicle = GameObject.FindWithTag("Car"); vehicleCam = GameObject.FindWithTag("CamCar"); vehicleCam.camera.enabled = false; vehicle.GetComponent<Drivetrain>().enabled = false; vehicle.GetComponent<CarController>().enabled = false; vehicleCam.GetComponent<AudioListener>().enabled = false; vehicle.GetComponent<SoundController>().enabled = false; } void Update (){ if ((Input.GetKeyDown("e")) && opened && !temp){ GetOut(); opened = false; temp = false; } } IEnumerator Action (){ if (!opened && !temp){ GetIn(); opened = true; temp = true; yield return new WaitForSeconds(waitTime); temp = false; } } void GetIn (){ //VehicleCamera.changeTarget = vehicleCam.transform.GetComponent<"VehicleCamera">(); //changeTarget.target = vehicleCameraTarget; pl.BroadcastMessage("LightOff"); // Disable all script behaviours on pl (Essentially deactivating pl control) Component[] coms = pl.GetComponentsInChildren<MonoBehaviour>(); foreach(var b in coms) { MonoBehaviour p = b as MonoBehaviour; if (p) p.enabled = false; } // Disable all renderers Component[] gos= pl.GetComponentsInChildren<Renderer>(); foreach( Renderer go in gos){ go.enabled = false; } pl.transform.parent = vehicle.transform; pl.transform.position = vehicleCameraTarget.transform.position; pl.rigidbody.isKinematic = true; pl.collider.isTrigger = true; weaponCamera.camera.enabled = false; weaponCamera.GetComponent<AudioListener>().enabled = false; mainCamera.camera.enabled = false; vehicleCam.camera.enabled = true; vehicle.GetComponent<Drivetrain>().enabled = true; vehicle.GetComponent<CarController>().enabled = true; vehicleCam.GetComponent<AudioListener>().enabled = true; vehicle.GetComponent<AudioSource>().enabled = true; vehicle.GetComponent<AudioSource>().enabled = true; vehicle.GetComponent<AudioSource>().enabled = true; vehicle.GetComponent<AudioSource>().enabled = true; vehicle.GetComponent<AudioSource>().enabled = true; vehicle.GetComponent<AudioSource>().enabled = true; vehicle.GetComponent<AudioSource>().enabled = true; vehicle.GetComponent<SoundController>().enabled = true; } void GetOut (){ // Enable all script behaviours on pl (Essentially deactivating pl control) Component[] coms = pl.GetComponentsInChildren<MonoBehaviour>(); foreach(var b in coms) { MonoBehaviour p = b as MonoBehaviour; if (p) p.enabled = true; } // Enable all renderers Component[] gos= pl.GetComponentsInChildren<Renderer>(); foreach( Renderer go in gos){ go.enabled = true; } pl.transform.parent = null; pl.rigidbody.isKinematic = false; pl.collider.isTrigger = false; pl.transform.position = GetOutPosition.transform.position; weaponCamera.camera.enabled = true; weaponCamera.GetComponent<AudioListener>().enabled = true; mainCamera.camera.enabled = true; vehicleCam.camera.enabled = false; vehicleCam.GetComponent<AudioListener>().enabled = false; vehicle.GetComponent<AudioSource>().enabled = false; vehicle.GetComponent<AudioSource>().enabled = false; vehicle.GetComponent<AudioSource>().enabled = false; vehicle.GetComponent<AudioSource>().enabled = false; vehicle.GetComponent<AudioSource>().enabled = false; vehicle.GetComponent<AudioSource>().enabled = false; vehicle.GetComponent<AudioSource>().enabled = false; vehicle.GetComponent<CarController>().enabled = false; vehicle.GetComponent<Drivetrain>().enabled = false; vehicle.GetComponent<SoundController>().enabled = false; } }
  2. ^^ Sorry but i can try to fix it . But i have no help . THX FOR NO HELP ^^
  3. hmmm ok i handerstand but : GameObject.Find("NetworkPlayer(Clone)"+ photonView.owner).active=false; NOT GOOD Player.GameObject.active=false; ( Error:Boo.Lang.Runtime.RuntimeServices.InvokeBinaryOperator) NOT GOOD GameObject.FindWithTag("Player").active=false; NOT GOOD (Reason : accumulate over time depanding ) For what enter it's ok but exit is not good. Help me please ?
  4. i have test with tag . Enter no probleme but , exit " GameObject.FindWithTag("Player").SetActive(true);" its not good.. NullReferenceException WehicleScript.Update () (at Assets/Car/Scripts/JavaScripts/WehicleScript.js:46)
  5. Hi guys , I have test the " enter exit vehicle " on network, (JS code) I have a probleme with the name of networkplayer. name is "NetworkPlayer+photon.owner" var car : Transform; var player : Transform; private var Player : GameObject; var exitPoint : Transform; var doorTriggerLeft : Transform; private var PlayerCamera : GameObject; var CarCamera : Camera; var isPlayerVisible : boolean; var Car : GameObject; //var MainCam : GameObject; //var WeaponCam : GameObject; var photonView : String = "PhotonView"; var CarScript : String = "ScriptName"; function Start (){ Car.GetComponent(CarScript).enabled=false; Player = GameObject.FindWithTag("Player"); //player = Transform.FindWithTag("Player"); } function Update(){ if (Input.GetButtonUp("Use")&& isPlayerVisible){ // make player invisible and still standing // player.gameObject.SetActiveRecursively(false); //player.gameObject.active = false; // GameObject.FindWithTag("Player").active=false; GameObject.Find("NetworkPlayer(Clone)"+ photonView.owner).active=true; // parent player to Exit Point // player.parent = exitPoint.transform; player.transform.localPosition = Vector3(-1.5,0,0); // parent PlayerParent to car exitPoint.parent = car.transform; // exitPoint.transform.localPosition = Vector3(-0.5,0,0); // Enable Car as controllabe object Car.GetComponent(CarScript).enabled=true; // MainCam.GetComponent("Camera").enabled=false; // WeaponCam.GetComponent("Camera").enabled=false; CarCamera.enabled = true; } else { if (Input.GetKeyUp("r")){ // make character visible again // player.gameObject.SetActiveRecursively(true); // player.gameObject.active = true; GameObject.Find("NetworkPlayer(Clone)"+ photonView.owner).active=false; // unparent player from everything // player.transform.parent = null; // parent Exit Point to door Trigger // exitPoint.parent = doorTriggerLeft.transform; // disable car as controllable GameObject.Find("Car").GetComponent("Car").enabled=false; // MainCam.GetComponent("Camera").enabled=true; //WeaponCam.GetComponent("Camera").enabled=true; CarCamera.enabled = false; } } } function OnTriggerEnter(Player : Collider) { isPlayerVisible = true; } function OnTriggerExit(Player : Collider) { isPlayerVisible = false; } My wrong line : "GameObject.Find("NetworkPlayer(Clone)"+ photonView.owner).active=true;" Have you a solution ?
  6. Hi ! Destructible Building with "Destructible Wall" My new contribution : Destroyed Building.unitypackage : 2mo https://www.dropbox.com/s/b0cwop7a7hw1jvf/Destroyed%20Building.unitypackage
  7. here is for you https://www.dropbox.com/s/yt1yg9syamqguxb/Monster.zip
  8. Hi ok I'll try with your masterpiece itts a monster ? Human ? hybrid ?
  9. anarko67

    3D Characters

    GIVE ME ALLS IDEAS FOR CHARACTERS 3D
×
×
  • Create New...