Unity 3D — Primitive Demo

I’ve decided to post my primitive demo of Unity 3D. There are a number of concepts at work here, and yet a few other snags that I hit along the way. You can view the demo here.

A few things had me tearing my hair out.

  • The alien could leave his house by walking towards the camera in the foyer. You cannot see the door, but the alien starts with his back turned to it. He could come back inside by approaching the front door, again behind him. If you wrecked the apartment before you left, then came back, the apartment stayed wrecked. (This is the desired behavior! So far, so good.)
  • The camera script that I used originally only accounted for one camera that followed the alien around. This wasn’t very user friendly in the small apartment. I wanted to have a more Resident Evil feel to the camera positioning and so I set up many different perspectives and used various invisible primitives as camera triggers.
  • After adding the multiple cameras, entering and leaving the house went completely to hell in a handbasket!

So what caused the problem with entering and leaving the apartment? It turns out that if more than one camera is “active” at a time, that really bizarre things can happen. Unity will apparently spend a great deal of time and energy trying to render a scene from many different perspectives that it doesn’t need to. This problem was masked when the application started up because I was careful to turn off the redundant cameras at the time. The problem was that when you came back into the apartment all the cameras “restored” and were all on by default. This caused all manner of problems. It completely hosed Chrome, and the .apk on my Droid phone would simply exhibit incredibly bizzare behavior such as the alien constantly flapping his arms. Once I got that problem taken care of, things worked as normal once again.

I hope soon to have an on-screen UI controller so that the app can be played on phones that don’t have a physical keyboard. That said, phones that do have a physical keyboard can play it just as it is.

Tags: ,

  1. No comments yet.