First 'Game' (fps test)

Update: faster, has a better hud, aiming system, sound effects, menu, added some barrels for kicks, health packs, shotgun, and another scene.

I say ‘game’, because I have been using unity for a few months, but never completed anything yet. Up until now, it’s been learning, testing and playing around. Also, this is by no means a full fledged game, but more of a first complete test.

Everything in the project is by me except for things that come with unity and the standard package, and also the brick/stone texture, which originally came from CG Textures, and was edited to tile. Needless to say, I’m bad with textures.

Sorry in advance for the long load time, I used a free ‘website making’ website to host it on, it seemed like a good idea at the time. If there are any issues, let me know. Also, if you have any feedback or advice to give, I appreciate it.

Objective:
Kill as many enemies as you can within the countdown, and try to stay alive.

Controls:
←/↑/↓/→ or a/w/s/d = left/forward/back/right
left mouse button = automatic machine gun
right mouse button = rifle
middle mouse button = shotgun
E key (hold down) = pick up and hold objects
E key (release) = throw held objects
M key (in game, not menu) = turn on / off music
Left Shift Key = turn on / off flashlight (level 2 only)

Some known Issues:

  1. For some reason, the instantiated CharacterControllers don’t seem to be able to use OnCollisionEnter (if you throw rigidbodies at them, they should take dammage); i’ve tried it with other simple setups, and I don’t know how to fix it just yet. It only works when certain rigidbodies come in contact with it, and even then only when it wants to.

  2. The AI isn’t perfect; at first, the enemies were made to run at you if they saw you. Then, since i was still working on a map with hallways and stairs and windows at the time, I made it so that they followed the nodes until they got to you. Now, I’m trying to get it so that the AI does whatever would be the best choice, but it’ll take more work; right now I haven’t finished that part, so it’s pretty basic and not that great.

  3. The GUI sucks; I didn’t do much on it.

  4. I didn’t spend much time on the enemy models, they were just generic blobish guys with a pretty basic texture.

  5. I can’t make good music.

Oh yeah, I should probably mention that the ones with the red eyes explode a few seconds after death.

For a first game this is a great job man.

Very good start here!

I got 39 kills.

This is and extremely good start.BTW, the mouse pointer needs to be locked to that drop down menu doesn’t come up when I try to use the semi-auto rife.

That’s true; thanks for the advice. :slight_smile:

Always Happy to help :smile:

Loading…while I wait…

In regards to OnCollisionEnter and other collider issues, check out the chart at the bottom of this page

to see how the collders work.

Where would the CharacterController fall there? The issue I’m having is that it DOES work, but only sometimes, and with certain rigidbodies. That, and I only have an issue if it’s instantiated.

crosshair is way too off from the gun…

I’ve been bored lately, haven’t been doing much with unity, so I decided to update this a little bit. It’s a bit faster, has a better hud, aiming system, sound effects, menu, added some barrels for kicks, health packs, shotgun, and another scene (not much of one, just one wall recycled over and over again).

Best of all, you can now turn off the music.

Love it.

BTW, How did you get the flashlight to move so smoothly?

That was fun.

I like it.

Fantastic first game. I had fun playing it. Maybe add some feedback when the player gets hurt. After the first red-eyed guy exploded it took me a couple seconds to realize that I had lost almost all of my health.

This is really good fun. I don’t know why, but I find the enemies rather cute and it kind of hurts me to shoot them all. :smile:

The flashlight isn’t a child of the player, but instead uses a script to tell it to move to the camera, and rotate in the same way as the camera over time. This way, when you move or rotate quickly, it moves slower and more smoothly, to catch up to your movement. The actual script is longer than this and includes the on/off switch (as well as a couple more things), but this is the part of the code used for movement.

var cam : Transform;
var moveSpeed = 15.0;
var rotationSpeed = 20.0;
function Update () {
     transform.position = (cam.position)*Time.deltaTime*moveSpeed + transform.position*(1-Time.deltaTime*moveSpeed);
     transform.rotation = Quaternion.Slerp(transform.rotation, cam.rotation, rotationSpeed*Time.deltaTime);
}

Good idea, I’m also thinking of adding a beeping sound for the last ten seconds of the timer, so that you know when it’s about to run out.

I’ve been a bit bored, so I’m adding a minimap feature. A box will be generated randomly on the map after a certain amount of kills (like the health packs), and when picked up it gives you a minimap for 30 seconds. It’s a lot more useful than it sounds :slight_smile:
When I make the minimap for level 1, I’ll update the web player.