Search Unity

My 1-Day Unity Game!

Discussion in 'Made With Unity' started by davidpolcino, Feb 14, 2007.

  1. davidpolcino

    davidpolcino

    Joined:
    Feb 2, 2006
    Posts:
    65
    I spent a little over a week going through the tutorials with the eval version, then decided to set myself a one-day challenge. Here it is! I am really impressed with Unity. I didn't even know what I was doing but was able to get a complete little mini-game done in 8 hours!

    You're in a gymnasium and you have an unlimited supply of big rubber balls. Knock down the person, bounce the balls around the walls and have fun.

    Usual controls apply: WASD or arrow keys to move, look with the mouse, left-click or cntrl-click to fire balls. I made an invisible room for the collisions so it seems to be really responsive (at least on the systems I tested it with). And the web player's only 2.5MB which blew me away.

    http://www.digitalcomplete.com/smashball 2.5MB web version
    http://www.digitalcomplete.com/smashball/SmashBall_OSX.zip 10MB OSX Universal version
    http://www.digitalcomplete.com/smashball/SmashBall_PC.zip 6MB PC version

    TO DO:
    Like I said, I constrained myself to an 8-hour development cycle. Things I'll hit in one more round are
    1) Make the character run around randomly
    2) Add sound
    3) Add projected shadow (I had this working but since I switch to ragdoll animation, it generates an error when I destroy the animated character. Any ideas?)
    4) Blob shadows on the balls (I had this but the projection camera was rolling all over, guess I have to figure out how to lock it down somehow. Any ideas?)
    5) Have the girl respawn in the position she was last in, and even better, play a transition animation of her getting up. (Any ideas here also, I can't seem to get her to instantiate where the ragdoll left off)
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    Very nice for a newbie!
     
  3. forestjohnson

    forestjohnson

    Joined:
    Oct 1, 2005
    Posts:
    1,370
    Poor lady. I left her alone to do her happy little dance and tried to get a ball in a basket. It took me a while but it is possible.
     

    Attached Files:

  4. drJones

    drJones

    Joined:
    Oct 19, 2005
    Posts:
    1,351
    that really is great for such a short amount of time ; )
     
  5. davidpolcino

    davidpolcino

    Joined:
    Feb 2, 2006
    Posts:
    65
    Good job on the basket! Sorry I didn't put a hole in the net! Unity's physics implementation is pretty great though!
     
  6. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Attach a script to the projection camera that gets the position of the ball and sets the projection camera to that (plus some height).

    --Eric
     
  7. Mr-Logan

    Mr-Logan

    Joined:
    Apr 13, 2006
    Posts:
    455
    i also tried shooting a ball into the net.. but after 5 minutes i ended up hittin the gal with a ricochet ball... and i decided to just give it up, nice piece of work for a single day.
    (and eminense fun to bombard the girl with balls, add more girls please ;) )
     
  8. davidpolcino

    davidpolcino

    Joined:
    Feb 2, 2006
    Posts:
    65
    Thanks Eric! Uh, what? :roll: :)
     
  9. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Like this:

    Code (csharp):
    1.  
    2. var objectToFollow : Transform;
    3.  
    4. function Update () {
    5.     transform.position = objectToFollow.position + Vector3.up * 1;
    6. }
    7.  
    Put that on the blob shadow projector, and drag the ball that it should follow onto the Transform slot. Adjust "Vector3.up * 1" as necessary (that puts it 1 meter above the ball).

    --Eric
     
  10. davidpolcino

    davidpolcino

    Joined:
    Feb 2, 2006
    Posts:
    65
    Great! Thanks. The only trouble I'm running into (also with the girl who goes from an animated character to ragdoll) is as soon as they get destroyed, any scripts that refer to them generate an error (as you'd expect). What's the trick to having gameobject scripts work well with instantiated objects?

    Thanks again!
     
  11. David-Helgason

    David-Helgason

    Moderator

    Joined:
    Mar 29, 2005
    Posts:
    1,104
  12. davidpolcino

    davidpolcino

    Joined:
    Feb 2, 2006
    Posts:
    65
    Okay, day 2 has been a little trickier! :?
    I have the girl running to random waypoints, it works great... except she's swimming on the ground!



    I have a character controller, a rigidbody and some scripts. I can tweak the containing mesh and bones to look right but then the collision is following along behind her. Hmm, any ideas?