Spawn actors anywhere on the screen except where one actor is at. HOW?

CabacoCabaco Member Posts: 414
edited July 2012 in Working with GS (Mac)
Hello.

I have a game where you control a ball with your finger by dragging, then every 1.5 seconds another actor is spawned randomly on the screen, I want to make it so that it doesn't spawn on top of the actor I'm dragging around.

Please help

Comments

  • ZoytZoyt Member Posts: 374
    Try these steps:
    > When an actor is trying to spawn somewhere, place an invisible test actor the same shape in that place that will return weather it collides with and object.
    > If so, try another place. Go to beginning.
    > If not, place that actor there.
    Good luck!
  • CabacoCabaco Member Posts: 414
    @Zoyt Thanks but the thing is, the actor spawns randomly anywhere on the screen, and the actor I dragged can be anywhere, so I want them not to collide. Do you know how to solve this? Can I send you the game project so you can see it for yourself?
  • CabacoCabaco Member Posts: 414
    Please help someone...!
  • ORBZORBZ Member Posts: 1,304
    @Zoyt gave you a working answer. Put an invisible TEST actor down to see if there is a collision, if not go ahead and spawn your real actor in that location, if there is a collision check a new location.
  • CabacoCabaco Member Posts: 414
    Oh I get it thanks! Made it!
  • mighty_poohmighty_pooh Member Posts: 20
    Im trying to do exactly what is told here and i might be doing it wrong.
    What im doing is create rule: All - Actor recieves event - overlaps or collides - with actor of type - my actor

    I leave the first behavior empty and then i put Spawn actor - random ting in Otherwise.

    Ive tryed making 8 copyes of this but they still spawn at the same location sometimes.
    I tryed to put the next rule into otherwise having a big stack of otherwise.

    It seems like they all spawn at the same time. Is there a way to put a little delay up after each spawn like 1ms or something to make sure the test is done at the right time?
Sign In or Register to comment.