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.

fpsarmedunity

Premium Member
  • Content count

    124
  • Joined

  • Last visited

  • Days Won

    2

fpsarmedunity last won the day on October 25 2016

fpsarmedunity had the most liked content!

Community Reputation

12 Good

About fpsarmedunity

  • Rank
    Member
  • Birthday 11/20/1950

Profile Information

  • Gender
    Male
  • Location:
    World
  1. fpskit 1.6 referring to player clone

    I dont Need to begin mate...if You or someone rose could Simply tell me how i can i correctly refer to a script held by a clone object(in this case the player) i would bè fine
  2. fpskit 1.6 referring to player clone

    I'm using a modified template of ai fpskit 1.6 as base of my project and Yes the damage trigger scriptis fronte hdk i own
  3. fpskit 1.6 referring to player clone

    thanks again OMA... i like use kits.. specificalyl your kit since throught it i learned a lot and i understand the code and i'm able to modify it and suits ti my needs LOL public GameObject playerref;playerref = Instantiate (playerprefab, ...); and yes i know how to instantiate playerclone what I was asking for is how can i refer to it from another script and specifically acces to a script(in this case HealthScript) pf the playerClone i tried this way... in Gamemanager.cs i made playerClone public public GameObject playerClone i tagged Gamemanager gameobject as "Gamemanager" and i modified the DamageTrigger.cs this way using UnityEngine; using System.Collections; public enum DamageType { DamageOnEnter, ConstantDamage, InstaKill }; public class HDK_DamageTrigger : MonoBehaviour { public DamageType TypeOfDamage; HealthScript healthScript; public float DamageOnEnterValue; public float ConstantDamageMultiplier; bool decreaseOverTime; private GameObject target; void Start () { target = GameObject.Find("Gamemanager").GetComponent<GameManager>().playerClone; target.GetComponent<HealthScript>(); } void Update() { if (decreaseOverTime) { healthScript.hitPoints -= Time.deltaTime * ConstantDamageMultiplier; } } void OnTriggerEnter (Collider col) { if (col.tag == "Player" && healthScript != null) { switch (TypeOfDamage) { case DamageType.DamageOnEnter: healthScript.PlayerFallDamage(DamageOnEnterValue); decreaseOverTime = false; break; case DamageType.ConstantDamage: decreaseOverTime = true; break; case DamageType.InstaKill: healthScript.hitPoints = 0f; decreaseOverTime = false; break; } } } void OnTriggerExit(Collider col) { if (col.tag == "Player" && healthScript != null) { decreaseOverTime = false; } } } but i got an error on game start on console NullReferenceException: Object reference not set to an instance of an object HDK_DamageTrigger.Start () (at Assets/MyScripts/Triggers/HDK_DamageTrigger.cs:25) referred t othis line of code target = GameObject.Find("Gamemanager").GetComponent<GameManager>().playerClone; i sincerly dont know what i missed
  4. fpskit 1.6 referring to player clone

    many thanks it's worked even if for a strange reason player get damaged but helth string is not updated and when player hit ponts reach zero player dont die LOL... btw is there a way to refer the player clone directly.. i 'm only asking to learn something new...
  5. fpskit 1.6 referring to player clone

    so...can you explain me more please=? i have the same issue with some scritps i made for door intraction ..worked well on prevoius version of the kit and now due to the player spawn ..not
  6. fpskit 1.6 referring to player clone

    Hi I'm having some issues with some scritps sincei cannot how correcly figure ho to call the player since it's spawned from gamemanager and not present in scene for start and i maded a scrit pthat workd fine in older fpskit but now i got an erorr relatedto the fact that player is instacianted on scene using UnityEngine; using System.Collections; public enum DamageType { DamageOnEnter, ConstantDamage, InstaKill }; public class HDK_DamageTrigger : MonoBehaviour { public DamageType TypeOfDamage; HealthScript healthScript; public float DamageOnEnterValue; public float ConstantDamageMultiplier; bool decreaseOverTime; void Start () { healthScript = GameObject.Find ("Player").GetComponent<HealthScript>(); //GameObject instance = GameObject.FindGameObjectsWithTag("Player"); } void Update() { if (decreaseOverTime) { healthScript.hitPoints -= Time.deltaTime * ConstantDamageMultiplier; } } void OnTriggerEnter (Collider col) { if (col.tag == "Player" && healthScript != null) { switch (TypeOfDamage) { case DamageType.DamageOnEnter: healthScript.PlayerFallDamage(DamageOnEnterValue); decreaseOverTime = false; break; case DamageType.ConstantDamage: decreaseOverTime = true; break; case DamageType.InstaKill: healthScript.hitPoints = 0f; decreaseOverTime = false; break; } } } void OnTriggerExit(Collider col) { if (col.tag == "Player" && healthScript != null) { decreaseOverTime = false; } } } in this script for example when i create the damage zone into unity i got an error due that healtscript is not found since "Player" object doesnt exist but exist player clone..any tips
  7. MadFPS Kit

    man you are doing a great job
  8. fpskit 1.6 menu system

    Can please someone could give me some tips on how remove the pause menu into aufpskit 1.6 sincei want to add my own menu and pause system? many thanks
  9. Add Bullet Physics IN FPS KIT SCRIPT

    many thanks.. sure i'll do
  10. Add Bullet Physics IN FPS KIT SCRIPT

    HI I know this is a very old old post-- but could someone give me some hints no how to start to modify fpskt scritps to add a penetration system into fpskit 1.6?
  11. My fps so far.

    LOL
  12. Camera Animation at game start

    Hi .. i'm having torubles t oset animation of camera ta game start ..i want to simulate player getup from terrain with an animation simialrt to this https://youtu.be/lnSwbf05Kxs?t=21 i have the animation and i create a simple script using UnityEngine; using System.Collections; public class TheBegining : MonoBehaviour { public GameObject cam; void Start() { //Screen.SetResolution(1920, 1080, true); //Camera.GetComponent<Animation>().Play(); cam.GetComponent<Animation>().Play("TheBeginning_GetUp"); Destroy(this.gameObject); } } but doesnt work.. cna please someone can tell me how to make animation to play automatically on start once.?? thanks
  13. Prevent Spotlight to disappear near walls

    ok many thanks i got it...
  14. Prevent Spotlight to disappear near walls

    btw this work if i attahc the spotliht to the zero pos of the player but waht about if i want to have a flashlight attachment for a wepaon..i tried and the issue return..
  15. Prevent Spotlight to disappear near walls

    yeah.. i cannot managed to work before since i modified the flashlight on the clone player lol.. ..figured it.. many thanks..
×