Help with controlling spawned actors

I'm spawning an actor every 2 sec and when I touch the screen I want the first actor to accelerate towards a specific position and get destroyed. When I touch screen again I want the next spawned actor to accelerate towards a position and so on. How can I achieve this? It's been bugging me all weekend, can't seem to figure this out:( pls help :)

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2016

    2 game attributes:

    A (set to 1)
    B (set to 0)

    . . . . . . . . . . . . .

    Spawner

    Timer:
    Every X seconds
    --Spawn Actor
    --Change A to A+1

    Rule:
    When the screen is touched
    --Change B to B+1

    . . . . . . . . . . . . .

    Actor

    1 self attribute, C (set to 0)

    Change C to A

    Rule:
    When C=B
    --move towards a specific position

  • IceboxIcebox Member Posts: 1,485
    edited May 2016

    @GreenfroggGames Hey here is a way to do it with tables if you want , spawn every 2 seconds then when button is down accelerate toward specific x and y location using tables. Hope it helps

  • GreenfroggGamesGreenfroggGames Member Posts: 224

    @Socks Great solutions as always, made my day. Thanks :)

    @Icebox thanks for the demo! Socks Solution was spot on but I'll definitely keep your demo for future projects :)

  • SocksSocks London, UK.Member Posts: 12,822

    @GreenfroggGames said:
    @Socks Great solutions as always, made my day. Thanks :)

    No problem, glad it works for you !

Sign In or Register to comment.