x


Enemy AI Script

I'm starting a zombie game and I want it when you select a zombie a label shows up above them saying what type of zombie they are. I'm not the best programmer but this is what i made up in a couple of minutes.

using UnityEngine;

using System.Collections;

public class NpcAI : MonoBehaviour {

public string NpcName;
public bool isEnemy;
public int NpcLevel;
public int NpcHealth;

function OnGUI()
    NpcInfo();

function NpcInfo()
    GUI.Label(new Rect(10, 10, 100, 20), NpcName ", " NpcLevel);

}

I know its horrible atm, i haven't coded in a while... I think with the help of the Unity Answer Community i can remember some of the lost coding in my head... The plan is to have it display the npc name above their head. Make them attackable with the isEnemy boolean(not needed at the moment) NpcLevel to display next to their name. The health to be displayed in a Gui Label.

more ▼

asked Dec 07 '10 at 02:56 AM

DoneDesign gravatar image

DoneDesign
15 3 3 7

Just to be clear, are you posting because the code in your post doesn't work and you're looking for help fixing it?

Dec 07 '10 at 05:24 AM Jesse Anders

yeah im getting some errors and their bugging me.

Dec 07 '10 at 12:42 PM DoneDesign
(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3811
x982
x671
x161

asked: Dec 07 '10 at 02:56 AM

Seen: 1153 times

Last Updated: Dec 07 '10 at 02:56 AM