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

Everything posted by lucian112

  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() -----------------------------------------------------------------------------------------------------------------------------
  14. I want your story of how all start.Like the start of "game development careear" .For me was on 13. I remember i find one of the first tutorials on romanian youtube with game development on GameMaker. For me was amazing. And I said. "I can do it." GameMaker was the start for me. I start with simple no sense game like jump until you die or smth like that. After 2 years i dicovered Unity. i was amazed. Like every kid,on 14-15 years old i was amazen of the power of"3D GAMES" . I started with simples. Again,a platformer. but this time ,was multiplayer ,cuz thanks unity asset store.like 50 players(school friends) playd my game in a single week and try to finish or beat the best time made by me on a "parkour" map.Just a capsule jumping on block by block.With higher and taller obstacle. I was popular in my schoool cuz this game. After 3 months of experimenting i start seriosly . And on 6-7 days i make the first fps project. (It was fps asset modifyed by me with some +scripts and models )(also an image) I was so happy when i see i made 10-30 downloads per day.So 1000 downlaods for me is a big number) But ,it was a free asset,and i was 10% skill on game development,so the rest of 89% of noob and 1% of dreams decide to transform in dream to make my own game from scratch/zero. Today,i am the same,lazy but more realistic knowing if u working hard enought ,you will se good results. I will be happy to see your story of how you start coding or game development. I really wanna read your begenning. much love ArmedUnity and staff/members
  15. On steam are a lot of trash games,but greenlight was a trash line. Like someone open the trash and throw on street or your good KFC But seriosly,some games are so bad. I get for example from random games just a key with a simple game where u just jump with no opstacle. Or trash game who try to be "survival" full with buggy. Yes, steam had or was had some trash.(and why they do 7 days ban? i like gambling with csgo)
  16. Thanks. Any tips for learn c# base in 1-2 months on 17 yold?
  17. Any ideas why my capsule dosen't move? Like i press W,A,S,D And nothing happend,please help! using System.Collections; using System.Collections.Generic; using UnityEngine; namespace player { public class Move : MonoBehaviour { public float speed; private void FixUpdate() { float WS = Input.GetAxis("Vertical") * speed; float AD = Input.GetAxis("Horizontal") * speed; transform.Translate(AD, 0, WS); } } }
  18. thanks... sorry for my mistakes and logic. I need to be more patient i think. Thanks again!
  19. No resolves. Plane didn't spawn. I make exactly like in video... Any ideas?
  20. Hi,i try to make a battle royale. I ;m copy paste script from video,and smth going wrong. My plane didn't spawn like in video. And i copy perfect and do it perfect.here my scripsts and here video: StartLogic: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Networking; public class StartLogic : NetworkBehaviour { public int playersNeeded; public NetworkManager NM; public GameObject Plane; private void FixUpdate() { if (NM.numPlayers == playersNeeded) { int Rot = Random.Range(0, 360); GameObject NewPlane = Instantiate(Plane, Vector3.zero, Quaternion.Euler(0, Rot, 0)); NetworkServer.Spawn(NewPlane); PlaneController PC = NewPlane.GetComponent<PlaneController>(); PC.enabled = true; PC.Moving = true; Destroy(this); } } } PlaneController: using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlaneController : MonoBehaviour { public bool Moving = false; [SerializeField] private float speed; [SerializeField] private GameObject Plane; private void FixUpdate() { if (Moving = true) { Plane.transform.Translate(transform.localPosition.x - speed, transform.localPosition.y, transform.localPosition.z); } } } I didn't know if i do something wrong,i retry 2 times and the same result
  21. i got it. I invert the brackets,thanks so much!
×
×
  • Create New...