How can I match the speed of one actor to another?
Dell7730
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
What is the layer order of A and B ?
A on top layer
Try placing A below B and see if that makes a difference (GS scans layer from bottom to top).
I did and it's the same side effect, lol
How is B constrained to A ?
it's the same, no difference at all
How is B constrained to A ?
Actor A constrain attribute position x,y to Actor B position x,y
...
it means i've attached Actor A to Actor B, so wherever Actor goes, Actor B goes lol
lol
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
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
Seeing as we are trying to resolve a technical issue can we have the detailed version How is actor B constrained to actor A ?
Yes Sir! My Apologies, lol
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
Can you state exactly how you are constraining actor B to actor A ? Details would be useful.
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 (!! !!) 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 !
Here you go, Sir!
And there's no method being kept secret, I hardly have any method to hide at all, lol