GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Constrain Attribute - problem with actors not moving in tandem (together)

mhedgesmhedges Raised on VCSPosts: 634Member
Hello -

I have recently found this little gem, and I'm already tinkering away at a little game.

I have an actor1 which is currently "coded" to move left or right when the left or right button is pressed. The logic I'm using is basically as follows:
1. I have 2 boolean attributes for movement (1 left, 1 right).
2. If move left = true, then actor1 moves left. Same logic applies to "move right".

I want actor2 to move left or right in tandem with actor1; it's below it, so they are expected to move together.

I am currently stuck. I have read about "constrain attribute" and tried using it according to various tutorials I've seen on Youtube, creating a "real attribute" for actor1's x position and another for y position, constraining real attribute 1's position to actor1's self position, and in turn constraining actor2's position to that of the real attribute for actor 1. As much as I've tried, I can't get actor 2 to move.

All constrain attribute tutorials I've seen deal with "mouse x and y", but I've seen none with "left and right buttons" and "move attribute". Is there a difference in usage/methodology between mouse and left/right buttons?


Thanks!
mhedges

Comments

This discussion has been closed.