Making 2 actors move up and down in relation to each other
umei
Member, PRO Posts: 21
I am trying to move 2 actors up and down in sync. I tired constraining the y position of the obstacle by using AAA*cos(self.time*BBB)+CCC
What do I do so that actors are in sync with each other?
What do I do so that actors are in sync with each other?
Comments
In your first actor:
Constrain attribute: game.Actor1X to self.Position.X
Constrain attribute: game.Actor1Y to self.Position.Y
Of course, you'll have some way to move this actor in here.
In your second actor:
Constrain attribute: self.Position.X to game.Actor1X
Constrain attribute: self.Position.Y to game.Actor1Y
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
then you just have to worry about making actor 1 move.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
If I just drag these actors on the scene and preview they do move however.
Is this a copulation thing ? :-B
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
change self.motion.lin.vel.y to +40
rule if attribute self.position.y is greater then 280
change self.motion.lin.vel.y to -40
rule if attribute self.position.y is less then 40
change self.motion.lin.vel.y to +40
Then I did what Braydon said to constrain actor2 y position to actor 1 y position with some gap in between. These 2 actors scroll on the screen right to left. So when I spawn these actors I do not get any up and down movement.
(joking )
The easiest way would be to use AAA*cos(self.time*BBB)+CCC . . . . like this:
My obstacles spawn every 2 second and I have a move behavior in them to move them left. It seems like I can not use move behavior with the up and down motion. Is their a limitation to the move behavior? Essentially the obstacles should move to the left while moving up and down.