How can I match the speed of one actor to another?

Dell7730Dell7730 Member, PRO Posts: 388

I've noticed that even if Actor B's X,Y position is constrained to Actor A, when Actor A moves at a faster speed, there's a rubber band effect that happens between them.

Answers

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

    What is the layer order of A and B ?

  • Dell7730Dell7730 Member, PRO Posts: 388

    A on top layer

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

    @dellagarpo said:
    A on top layer

    Try placing A below B and see if that makes a difference (GS scans layer from bottom to top).

  • Dell7730Dell7730 Member, PRO Posts: 388

    @Socks said:

    I did and it's the same side effect, lol

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

    @dellagarpo said:
    I did and it's the same side effect, lol

    How is B constrained to A ?

  • Dell7730Dell7730 Member, PRO Posts: 388

    @Socks said:
    How is B constrained to A ?

    it's the same, no difference at all

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

    @dellagarpo said:
    it's the same, no difference at all

    How is B constrained to A ?

  • Dell7730Dell7730 Member, PRO Posts: 388

    Actor A constrain attribute position x,y to Actor B position x,y

  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2015

    ...

  • Dell7730Dell7730 Member, PRO Posts: 388
    edited March 2015

    @Socks said:

    it means i've attached Actor A to Actor B, so wherever Actor goes, Actor B goes lol

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

    @dellagarpo said:
    it means i've attached Actor A to Actor B, so wherever Actor goes, Actor B goes lol

    lol

  • RabidParrotRabidParrot Formally RabidParrot. Member Posts: 956

    Should look like,

    Constrain attribute,
    Actor B.position.x to Actor A.position.x

    Constrain attribute,
    Actor B.position.y to Actor A.position.y

  • Dell7730Dell7730 Member, PRO Posts: 388
    edited March 2015

    @RabidParrot said:
    Should look like,

    Constrain attribute,
    Actor B.position.x to Actor A.position.x

    Constrain attribute,
    Actor B.position.y to Actor A.position.y

    it is like that, lol... I just answered in a short cut, lol... the thing is, if Actor A goes at a high speed, Actor B can't catch up

  • AlchimiaStudiosAlchimiaStudios Member Posts: 1,069

    @dellagarpo said:

    Turn it into a high speed chase game , problem solved! >:)

    Post your rules including the movement portion and the constrains or maybe a project we can look at.

    Follow us: Twitter - Website

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

    @dellagarpo said:
    I just answered in a short cut

    Seeing as we are trying to resolve a technical issue can we have the detailed version :smile: How is actor B constrained to actor A ?

  • Dell7730Dell7730 Member, PRO Posts: 388

    @Socks said:
    Seeing as we are trying to resolve a technical issue can we have the detailed version :smile: How is actor B constrained to actor A ?

    Yes Sir! My Apologies, lol

  • Dell7730Dell7730 Member, PRO Posts: 388

    Here's what i've done, and it's with two pictures, Actor A rotating clockwise, Actor B rotating counter clockwise trying to have a little kaleidoscope effect... and they're moving at random speeds, which when at high speed, Actor B get's left behind a little, just a little, just wondering if there's a way that won't happen.

    As Rabidparrot said, here's how I did it.

    Constrain attribute,
    self.position.x to Actor A.position.x

    Constrain attribute,
    self.position.y to Actor A.position.y

  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2015

    @dellagarpo said:
    As Rabidparrot said, here's how I did it.

    Can you state exactly how you are constraining actor B to actor A ? Details would be useful.

  • Dell7730Dell7730 Member, PRO Posts: 388

    @Socks said:
    Can you state exactly how you are constraining actor B to actor A ?

    hehehe

  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2015

    @dellagarpo said:
    hehehe

    I was simply after the details . . .

    examples: I am using two scene attributes, they are integers and track Actor A's X and Y position (etc) . . . or . . . I unlocked actor B in the scene and directly reference actor A's self X and self.Y using two constrain behaviours (etc) . . . or . . . Actor A has two integer self attributes, these are constrained to self.X and self.Y and actor B is unlocked and references these two attributes via two constrain behaviours (etc) . . . or . . . I made two game attributes, they are 'real' attributes, in actor A I placed two constrain behaviours which constrain these two game attributes to A's self.X and self.Y, Actor B then constrains (etc) . . . or . . . I made two scene attributes, which are 'real' and then in Actor B . . . . etc etc etc

    . . . as there is often a more efficient way to constrain two actors (depending on what method you are currently using), but if you want to keep your method secret for whatever reason (!! :o :D :) !!) then I'm certainly not going to torture you until your reveal how you are constraining B to A, answers like "self.position.x to Actor A.position.x" doesn't really tell us anything useful.

    My last suggestion would be to experiment with layer position in relation to how the actors are constrained to each other, I've often started out with very noticeable lag and been able to remove it entirely playing around with these.

    Good luck ! :smile:

  • Dell7730Dell7730 Member, PRO Posts: 388

    @Socks said:
    Good luck ! :smile:

    Here you go, Sir!

  • Dell7730Dell7730 Member, PRO Posts: 388

    And there's no method being kept secret, I hardly have any method to hide at all, lol

Sign In or Register to comment.