Actor trailing other actor

AtlantenAtlanten Member, PRO Posts: 56
edited November -1 in Working with GS (Mac)
Hello

I want to make an actor copy the position of another actor, but time delay it so that it trails after rather than sit on top. So if I had several actors doing that, with increasing time delay, I'd get a caterpillar-like motion.

I can't find a way to delay the actor's timing.

Do you know how to achieve that?

Any help would be much appreciated. Thanks!

Comments

  • KamazarKamazar Member Posts: 287
    Not totally sure if this'll work, but maybe with some tweaking.

    You'll need to create two real attributes to track the location of the actor you're following.

    Every second, constrain the location of the main actor to the two attributes made earlier.
    Have the following actor move/accelerate towards those coordinates.
  • AtlantenAtlanten Member, PRO Posts: 56
    Thanks for the advice!

    I tried it out, it kind of works, but it's not looking very smooth.

    I'm trying now to constrain the positions, but subtracting the lead object's velocity from the follow object's position.. Looks like I'll be able to get a spring-y lag.

    I was hoping for something like a time controlling function? So you could just set the object's relative time to -1 second. Would be awesome
  • SDMGSDMG Member Posts: 280
    here is a test without the usage of any timer-behaviour...

    http://www.gamesalad.com/game/play/17011

    If anyone is interested please give me your email and i will you send you the scene-file...

    cheers

    SDMG
  • xactoxacto Member Posts: 146
    SDMG,

    That is smooth... nice! I would love to see the code.
    I will need something like this for a health bar for one of my BOSSes.

    Would be a great one for the WIKI, BTW.

    Xacto

    --------------------------------
    FireStar
    http://gamesalad.com/game/play/8901
  • quantumsheepquantumsheep Member Posts: 8,188
    Very nice indeed!
  • AtlantenAtlanten Member, PRO Posts: 56
    Very cool!!

    Please send, I'd love to see how this is done.

    manschat8537 [a] gmail.com

    Thanks!
  • quantumsheepquantumsheep Member Posts: 8,188
    I don't think I'd ever want to add you to my contacts list with an email address like that, Atlanten ;)
  • AtlantenAtlanten Member, PRO Posts: 56
    Ha ha! It's not as bad as it seems. My first name is Måns, and I use it for chat
  • quantumsheepquantumsheep Member Posts: 8,188
    Sure, lady, tell it to the judge!

    And SDMG, can you send me your file? It'd be very useful for some of my games! I think you already have my email!

    Oh, and you get a mention in the credits of every game of course ;)
  • AtlantenAtlanten Member, PRO Posts: 56
    Update!

    For anybody looking for a solution to this, example 2 in this article got it working like a charm:

    http://gamesalad.com/wiki/doku.php?id=how_to_gsc_follow_another_actor
Sign In or Register to comment.