Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

College Project Unity Problem

Discussion in 'Getting Started' started by unity_4444a111, Jul 6, 2019.

  1. unity_4444a111

    unity_4444a111

    Joined:
    Jun 9, 2019
    Posts:
    1
    Excuse me! We are college students who're making our own game for our graduation project and we are facing some Unity problems. Because we are new with Unity, we hope someone could solve our problems!

    This is our github:
    https://github.com/opp1opp1/Seminar-in-information-system-management-NCUE109-

    Below are the following questions:
    1. The rigidbody of our character doesn't work. We want our character can collide with obstacles like walls or pillars. (The code about our character movement is in playmove.cs)
    2. The second problem is that our enemies' health bars couldn't work. There was just one random health bar can work perfectly but others couldn't. (The code about our enemies' health bars is in enemyhealthbar.cs)
    3. The third is that how can we access our enemies' components that is called NAV MESH AGENT? Cause in other scripts we want to change the speed of our enemies.

    Thank you for reading our problems above! We will be grateful for you to help us solve these problems!
    Thank you!
     
  2. Green11001

    Green11001

    Joined:
    Apr 14, 2018
    Posts:
    397
    Ummm.... can you include pictures and not just a project for us to download?
    as for #2 did you set all your references correctly? Tried logging?
    as for #3, did you try getcomponent?
     
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    You're unlikely to find people who will download and sift through your project. Just post relevant code directly into the forum using CODE tags (see the sticky at the top of the Scripting forum for how to use CODE tags).

    First step though when trying to figure out why code is behaving in an unexpected way, is to just pepper your code with Debug.Log statements so you can track what path your code is actually taking, and output relevant information. Also, of course check for run time errors, such as null reference errors, in the console (or player log if running from a build). Most of the time if you do just that you will quickly figure out where the problem is.

    Some other things you can do is temporarily set some variables as Public so you can see their values in the inspector while the game is playing, or you could use a debugger to get more detailed information.
     
    Ryiah likes this.
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Debug.Log it!
     
    Last edited: Jul 12, 2019
    Joe-Censored likes this.