Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: escpodgames on December 24, 2014, 05:39:49 AM

Title: Level Zones
Post by: escpodgames 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.
Title: Re: Level Zones
Post by: escpodgames on December 24, 2014, 03:43:26 PM
Tried the raycast method and it works perfectly!