Last Collided Region?

EatMoreHippo

  • Posts: 62
I'm trying to make a behavior that moves the camera to the middle of the region you are within but I'd rather not enter all the regions manually. Is there a way to have the actor realize that it has entered a region and then use that region in a code block?

Jon

  • *
  • Posts: 17524

Alexin

  • *
  • Posts: 3127
In the meantime:

Code: [Select]
var regions:Array = getAllRegions();

for each(var region:Region in regions)
{
if(region.containsActor(actor))
{
//Do something...
}
}
"Find the fun"
alexin@stencyl.com

EatMoreHippo

  • Posts: 62
Thank you both. I'll try Alexin's method in the morning but can't wait for events. Looks really good!