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.

Aeleas

Member
  • Content Count

    145
  • Joined

  • Last visited

  • Days Won

    3

Aeleas last won the day on January 8

Aeleas had the most liked content!

Community Reputation

8 Neutral

1 Follower

About Aeleas

  • Rank
    Member

Profile Information

  • Gender
    Male
  • Location:
    this world

Recent Profile Visitors

1,003 profile views
  1. You did well in this game. Congratulation .
  2. Thank you for notes me that. I was sleeping when post this. Your script is correct and will work only on parent objects. I'm looking for the child objects inside the parent object. Do I need to use loop or foreach function to active child objects one by one? Or, I have to use list or array for them also ? I don't want to Drag&Drop. Update 1: For all those have same issue. Here how I solved it and sorry for misunderstanding. It was my fault not explained well my problem. public GameObject[] weapon_carry_pistol = new GameObject[3] // parent object private GameObject[] p1_pis; // child objects private int[] p1_carry_number = new int[6]; void Update () { p1_pis = new GameObject[weapon_carry_pistol[0].transform.childCount]; for (int i = 0; i < weapon_carry_pistol[0].transform.childCount; i++) { p1_pis[i] = weapon_carry_pistol[0].transform.GetChild(i).gameObject; p1_pis[i].SetActive(false); } for (int t = 0; t < p1_carry_number[0]; t++) { p1_pis[t].SetActive(true); } }
  3. Hi How to activate/deactivate the objects in my array by using numbers ? As you see on image, there is a parent and 6 child objects. In my script, "weapon_carry_pistol" is the parent object. I need to put all child objects inside it on my array and activate them by numbers. If activeObjects = 1. the first element in my array will be active. and so on. public GameObject[] weapon_carry_pistol = new GameObject[3]; // three parent objects with 6 child objects inside each one. public int activeObjects; void Start() { } // Update is called once per frame void Update() { }
  4. We will do our best to help you. Where is your scripts ? If you looking for a series tutorial youtube is your friend.
  5. Many people suffering form this issue. Maybe this will help you. In " Canves Scaler", change the "screen match mode" to " match hight or width" and make the " Match" 0.5.
  6. Aeleas

    Freelance ??

    Maybe we can help you with this. What kind if problem do you have ? If you looking for freelance there many website can help you with this. Be careful...choose people with high reputation.
  7. Don't forget YouTube. It's full of tutorials explaining form zero about third person.
  8. Good to hear this. Good Luck.
  9. You right. List is more flexible for this. Thanks god that I found some one give me good solution. Here is how he solve it. public List<GameObject> enemiesInRange = new List<GameObject>(); public int hox; int SortByDistanceToMe(GameObject a, GameObject b) { float squaredRangeA = (a.transform.position - transform.position).sqrMagnitude; float squaredRangeB = (b.transform.position - transform.position).sqrMagnitude; return squaredRangeA.CompareTo(squaredRangeB); } void Update() { enemiesInRange.Sort(SortByDistanceToMe); hox = enemiesInRange.Count; if (hox == 1) { enemiesInRange[0].GetComponent<enemypath>().enemy_checker = true; } if (hox == 2) { enemiesInRange[0].GetComponent<enemypath>().enemy_checker = true; enemiesInRange[1].GetComponent<enemypath>().enemy_checker = true; } if (hox == 3) { enemiesInRange[0].GetComponent<enemypath>().enemy_checker = true; enemiesInRange[1].GetComponent<enemypath>().enemy_checker = true; enemiesInRange[2].GetComponent<enemypath>().enemy_checker = true; } } void OnTriggerEnter(Collider other) { if (other.CompareTag("enemy") && hox < 3) // list have three enemies enemiesInRange.Add(other.attachedRigidbody.gameObject); } void OnTriggerExit(Collider other) { if (other.CompareTag("enemy")) enemiesInRange.Remove(other.attachedRigidbody.gameObject); }
  10. Hi. I need to make my object read the first 3 objects that close to him, and sort it by the distance. The first in the array is the nearest one...and so on. After that, find a script inside those in the list to active the bool option "enemy_checker". public int numSelectors; public GameObject[] Enemy; public float[] distance; void Update() { Enemy = GameObject.FindGameObjectsWithTag("enemy"); for (int i = 0; i < Enemy.Length; i++) { distance[Enemy.Length] = Vector3.Distance(gameObject.transform.position, Enemy[i].transform.position); numSelectors = Enemy.Length; if (numSelectors < 3) { Enemy[i].GetComponent<enemypath>().enemy_checker = true; } } }
  11. Try to upload that model to check it for you.
  12. Thank you guys. Yes, I have to rig the shield.
  13. It's possible to add body shield to model after done from animated ? So, when character sit,jump or run, this shield will fit the movement of the chest. When attached this shield object to chest bone I get this. How to solve this ?
  14. yeah, I know this feeling . Look, before it happens to me when upgrade my unity version. To solve this I worked on every script I wrote and check it step by step. Good look man. you got yourself long night today.
×
×
  • Create New...