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.

lucian112

Member
  • Content Count

    94
  • Joined

  • Last visited

  • Days Won

    1

lucian112 last won the day on June 8

lucian112 had the most liked content!

Community Reputation

3 Neutral

1 Follower

About lucian112

  • Rank
    Member

Profile Information

  • Gender
    Male
  • Location:
    Romania
  • Interests
    Comunity helping in unity 3d!

Contact Methods

Recent Profile Visitors

1,182 profile views
  1. Thanks. Work much beter than mine!
  2. Hello,so i;m trying make a health script ,it's working,but i had a problem on guy. Is not showing. Any idea how to make a gui texture? or convert to new UI? Here's my script using System.Collections; using System.Collections.Generic; using UnityEngine; public class BaseEntity : MonoBehaviour { [SerializeField] protected Texture2D HealthBarTexture; protected float currentHealth = 100; public float CurrentHealth { get { return currentHealth; } } protected float maximumHealth = 100; public float MaximumHealt { get { return maximumHealth; } } void Start() { currentHealth = maximumHealth; } // Update is called once per frame void Update() { } public void TakeDamage(float damageAmmount) { currentHealth -= damageAmmount; if(currentHealth <= 0.0f) { Debug.Log("PlayerDie"); gameObject.SetActive(false); return; } void OnGUI() { if(HealthBarTexture != null) { GUI.color = Color.Lerp(Color.red, Color.green, currentHealth / maximumHealth); GUI.DrawTexture(new Rect(10, 10, 200 * currentHealth / maximumHealth, 10), HealthBarTexture); } } } }
  3. So,i found this tutorial on youtube: Is good for starting learning c#?
  4. Thanks.. but parachute keep not despawning/hide
  5. So,i keep do my game,and i am again,after 1 week of progres,on a dead point. Basic,my parachute dosen't despawn. Why? I can't find my mistake. Any way,if can help me,please,help.. Script: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace Player { public class Look : MonoBehaviour { public float sensitivity; public GameObject Player; private Vector2 ML; public float Gravity; public Vector3 MacxVelocity; public float WSpeed; public bool GameStarted; private bool skydiving; private bool Gliding = false; private bool Setup; private float GlidingH = 1; public float GlidingGravity; public Vector3 GlidingMacxVelocity; public GameObject Glider; public float LandingH; private void Start() { Cursor.lockState = CursorLockMode.Locked; } public void Update() { Vector2 CL = new Vector2(Input.GetAxisRaw("Mouse X") * sensitivity, Input.GetAxisRaw("Mouse Y") * sensitivity); ML += CL; if (GameStarted) { if (Gliding == false) { if (skydiving == false) { Player.GetComponent<Move>().enabled = false; transform.localPosition = Vector3.zero; transform.localRotation = Quaternion.Euler(-90, 0, 0); } ML.y = Mathf.Clamp(ML.y, 0, 90); Player.transform.localRotation = Quaternion.Euler(-ML.y + 180, ML.x, 0); Rigidbody RB = Player.GetComponent<Rigidbody>(); RB.useGravity = false; if (RB.velocity != MacxVelocity) { RB.AddForce(0, -Gravity, 0); } if (Input.GetKey(KeyCode.W)) { Player.transform.position += transform.forward * Time.deltaTime * WSpeed; } RaycastHit hit; if (Physics.Raycast(transform.position, -transform.up, out hit, GlidingH)) { if (hit.transform.tag == "Map") { Gliding = true; } } if (Input.GetKey(KeyCode.G)) { Gliding = true; } } else { Debug.Log("Gliding"); if (Setup == false) { Glider.SetActive(true); transform.localPosition = new Vector3(0, 0.751f, 0); transform.localRotation = Quaternion.Euler(0, 0, 0); Setup = true; Player.GetComponent<Move>().enabled = true; gameObject.transform.parent.FindChild("Canvas").FindChild("txtSkydive").gameObject.SetActive(false); } Rigidbody RB = Player.GetComponent<Rigidbody>(); RB.useGravity = false; if (RB.velocity != GlidingMacxVelocity) { RB.AddForce(0, -GlidingGravity, 0); } ML.y = Mathf.Clamp(ML.y, -90, 90); Player.transform.localRotation = Quaternion.Euler(0, ML.x, 0); transform.localRotation = Quaternion.Euler(-ML.y, 0, 0); //Check if we need to land yet RaycastHit hit; if (Physics.Raycast(transform.position, -transform.up, out hit,LandingH)) { if (hit.transform.tag == "Map") { Debug.Log("Landed"); GameStarted = false; Glider.SetActive(false); transform.localPosition = new Vector3(0, 0.751f, 0); gameObject.transform.parent.FindChild("Cancas").FindChild("txtSkydive").gameObject.SetActive(false); } } } } else { ML.y = Mathf.Clamp(ML.y, -90, 90); Player.transform.localRotation = Quaternion.Euler(0, ML.x, 0); transform.localRotation = Quaternion.Euler(-ML.y, 0, 0); } if (Input.GetKeyDown(KeyCode.Escape)) { Cursor.lockState = CursorLockMode.None; } } } }
  6. lucian112

    warning CS0649

    Hi,i try to make a battleroyale,and the error is this: warning CS0649: Field `Player.Look.skydiving' is never assigned to, and will always have its default value `false' i tend this is because my player doesen't parachute/skydiving from plane.
  7. maybe programing is not for me
  8. Hi,still with this error after one week of searching how to resolv it.. Assets/Scripts/PlaneCameraController.cs(34,60): error CS0246: The type or namespace name `Look' could not be found. Are you missing `Player' using directive? If someone want to help me thanks,if not is ok. I konw i'm beeing so annoing now... Any way,thanks this is scripts using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlaneCameraController : MonoBehaviour { public NetVars NV; public GameObject Camera; public GameObject SkyDiveText; private void Start() { NV = GameObject.Find("_NetVars(Clone)").GetComponent<NetVars>(); } private void Update() { if (NV.GameStarted) { //activate the camera Camera = GameObject.Find("PlanePivot(Clone)").transform.Find("Plane").transform.Find("PlayerCamera").gameObject; Camera.SetActive(true); } if (NV.PhaseIndex == 1) { SkyDiveText.SetActive(true); if (Input.GetKeyDown(KeyCode.Space)) { gameObject.transform.position = Camera.transform.parent.transform.position; transform.Find("CameraPivot").GetComponent<Look>().GameStarted = true; Destroy(Camera); this.enabled = false; } } } } Look script using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Player { public class Look : MonoBehaviour { public float sensitivity; public GameObject Player; private Vector2 ML; public float SkydivingMass; public bool GameStarted; private bool skydiving; private void Start() { Cursor.lockState = CursorLockMode.Locked; } public void Update() { Vector2 CL = new Vector2(Input.GetAxisRaw("Mouse X") * sensitivity, Input.GetAxisRaw("Mouse Y") * sensitivity); ML += CL; if (GameStarted) { if (skydiving == false) { transform.localPosition = Vector3.zero; transform.localRotation = Quaternion.Euler(-90, 0, 0); Player.GetComponent<Rigidbody>().mass = SkydivingMass; } ML.y = Mathf.Clamp(ML.y, 0, 90); Player.transform.localRotation = Quaternion.Euler(-ML.y + 180, ML.x, 0); transform.localRotation = Quaternion.AngleAxis(-ML.y, Vector3.right); } else { ML.y = Mathf.Clamp(ML.y, -90, 90); transform.localRotation = Quaternion.AngleAxis(-ML.y, Vector3.right); Player.transform.localRotation = Quaternion.AngleAxis(ML.x, Player.transform.up); } if (Input.GetKeyDown(KeyCode.Escape)) { Cursor.lockState = CursorLockMode.None; } } } }
  9. lucian112

    error CS0246

    of corse.. https://imgur.com/a/c8rqwj9
  10. lucian112

    error CS0246

    https://imgur.com/a/25EoJy8 is called like this.. Any ideas? Or what's wrong
  11. lucian112

    error CS0246

    you had team viwer to help me if u want or had some time. I had Look script.Or u can explain how to resolv it? https://imgur.com/a/kQKmiMQ
  12. lucian112

    error CS0246

    Any ideas why? Exactly like in video.. error CS0246: The type or namespace name `Look' could not be found. Are you missing `player' using directive? Here's the script --------------------------------------- using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlaneCameraController : MonoBehaviour { public NetVars NV; public GameObject Camera; public GameObject SkyDiveText; private void Start() { NV = GameObject.Find("_NetVars(Clone)").GetComponent<NetVars>(); } private void Update() { if (NV.GameStarted) { //activate the camera Camera = GameObject.Find("PlanePivot(Clone)").transform.Find("Plane").transform.Find("PlayerCamera").gameObject; Camera.SetActive(true); } if (NV.PhaseIndex == 1) { SkyDiveText.SetActive(true); if (Input.GetKeyDown(KeyCode.Space)) { gameObject.transform.position = Camera.transform.parent.transform.position; transform.Find("CameraPivot").GetComponent<Look>().GameStarted = true; Destroy(Camera); this.enabled = false; } } } }
  13. lucian112

    Please help

    RESOVED!RESOVED!RESOVED!RESOVED!RESOVED! Hello,i try rhis battleRoyale series and I am in a DeadPoint from ep 2-3 i had this bug. Like,when i press play,my plane spawn infinite,like infinte game objects and i don't know i do wrong. I try to check all script and read and nothing to resolv this.. I get this errors: ----------------------------------------------------------------------------------------------------------------------------- UnassignedReferenceException: The variable m_Target of NetworkTransformChild has not been assigned. You probably need to assign the m_Target variable of the NetworkTransformChild script in the inspector. UnityEngine.Transform.get_localPosition () UnityEngine.Networking.NetworkTransformChild.Awake () (at C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkTranformChild.cs:141) UnityEngine.Object:Instantiate(GameObject, Vector3, Quaternion) StartLogic:FixedUpdate() (at Assets/Scripts/StartLogic.cs:23) ----------------------------------------------------------------------------------------------------------------------------- The prefab 'PlanePivot' has multiple NetworkIdentity components. There can only be one NetworkIdentity on a prefab, and it must be on the root object. UnityEngine.Networking.NetworkManagerHUD:Update() ----------------------------------------------------------------------------------------------------------------------------- The referenced script on this Behaviour (Game Object '<null>') is missing! UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate() ----------------------------------------------------------------------------------------------------------------------------- The referenced script on this Behaviour (Game Object 'MiniMap') is missing! UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate() -----------------------------------------------------------------------------------------------------------------------------
×
×
  • Create New...