playMaker

Author Topic: Level Zones  (Read 1883 times)

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Level Zones
« on: December 24, 2014, 05:39:49 AM »
Hi,

I'm making a game where I load levels based on 10x10 sized(unity units) zones based on where the player is. So at anyone time there would be the current zone the player is in and 8 surrounding zones (See image) When the player moves out of this zone it will then load/unload the zones so there are 8 zones surrounding the new zone.

Any ideas on how to get these 8 zones and store them as gameobjects at runtime so I can manage the above system. Obviously I could manually assign them per zone, but that is A. a lot of work and B. could introduce errors on my part.

My current thinking so far is to Raycast a ray up, down,left,right and store the game objects it hits, if the collision is less than 10x10 I can also ray cast on the diagonals.

Thought id see if anyone had any better ideas before trying this.
« Last Edit: December 24, 2014, 06:13:54 AM by LampRabbit »

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Level Zones
« Reply #1 on: December 24, 2014, 03:43:26 PM »
Tried the raycast method and it works perfectly!