Inside a box?

Is there a simple scriptable way of testing if a transform node is inside a rectagualr box? I am trying to set up a simple zoning sytem and don’t want to have to hand enter 8 points (to define the corners of the box) each time I change the shape of the zone - it is much quicker just to change the shape of a (non-rendering) mesh.

thanks,
Richard.

PS I am not ready to go for a full octree system yet!

http://unity3d.com/Documentation/ScriptReference/Bounds.Contains.html

I also attached some scripts for a really simple but effective visibility culling solution using culling masks. Probably similar to what you wanted to do. I am gonna get that on the wiki soon too.

27866–1040–$visibilityculling_164.zip (3.55 KB)

Hmm, I could be mistaken, but your zone sounds like a trigger zone, say a mesh with a collider set to trigger and renderer.enabled = false;
…Look I know you know this better than me but isnt this kinda workable?

var zone : GameObject;
function OnTriggerEnter(){
zone.renderer.enabled = true:
}

You did say testing, right? Im only using the render method because it fairly obvious to the eye when its been triggerredd…

I guess you probably mean something more sophisticated huh, like not using collision detection…
AC

Thanks Joachim, Targos - I’ll give them a try now. Below is a teaser of game screen snaps what I am working on.

thanks again,
Richard.

Please please put me on your beta testing list? Looks absolutely amazing Rich
AC

If the gameplay is half as nice as that environment, that’s a winner.

looks great richard, very good use of shadows. you should post some higher res pics in the showcase.

can’t wait to try it out ; )

Thanks guys - I will post hi res versions when I have sorted the textures - at the moment everything it just atlas mapped and tiled. IT is only really at the blocking out stage.

cheers,
Richard.

Looking really nice man, I am looking forward to seeing more of this.

-Jeremy

holy crap that looks great

what kind of game is this??

Thanks guys. The game is a Rivenesque thing atm :slight_smile:

Richard.

Looks great Richard! :smile:
Nice shadows.

:slight_smile:

Definitely put the first playable alpha you can onto the Forums. It’s a great way to get critique for your work, as well as a lot of praise, as you’ve seen.

Sadly the bus factor (Bus factor - Wikipedia) has intervened. A game of that nature is too big a project for me alone given that I already have a day job and family commitments - maybe some other time in the future :frowning:

thanks,
Richard.

Shame Richard! Isn’t it time to leave work and make games and do animation full time?

Now there’s a big temptation!

R.

The world would be a better place if you made more videogames Richard

:slight_smile:

AC

Hi Targos - long time no talkee :slight_smile: Well I am trying and certainly haven’t given up!

R.

Damn I had a quick look at your demo on my powerbook g4 but you pulled the link down b4 I could check it out on my mbp…Feel free to pm me a linky linky :slight_smile:

Aaron