Placing an Object in the Center of Two Actors
![thatfoolsean](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
Okay, so I asked a question yesterday, but I think I was asking the wrong question. This is the right one. I think ![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
I am trying to make a game that features 2 players. Each player controls an actor (seen in the below screenshots as a red and blue square). When the player touches a square, they can move it with their finger anywhere on screen. I want to make it appear as though each of the squares is holding a "log" or pipe, with each square holding one side on the log.
In order to make this look right, I think that I need to have an algorithm that constantly keeps the "log" actor in between the two "square" actors (or player avatars). The log would always create a straight line that connected both of the squares, so the angle would have to be adjusted as well.
I am absolutely terrible at geometry, so I don't know exactly what this algorithm would look like, or if this is the right approach. I have attached some screens that I have mocked up that I hope demonstrate what I am trying to do, if anyone has any tips, I would be incredibly appreciative.
Thanks,
Sean
http://www.flickr.com/photos/thatfoolsean/
![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
I am trying to make a game that features 2 players. Each player controls an actor (seen in the below screenshots as a red and blue square). When the player touches a square, they can move it with their finger anywhere on screen. I want to make it appear as though each of the squares is holding a "log" or pipe, with each square holding one side on the log.
In order to make this look right, I think that I need to have an algorithm that constantly keeps the "log" actor in between the two "square" actors (or player avatars). The log would always create a straight line that connected both of the squares, so the angle would have to be adjusted as well.
I am absolutely terrible at geometry, so I don't know exactly what this algorithm would look like, or if this is the right approach. I have attached some screens that I have mocked up that I hope demonstrate what I am trying to do, if anyone has any tips, I would be incredibly appreciative.
Thanks,
Sean
http://www.flickr.com/photos/thatfoolsean/
Best Answer
-
RThurman Posts: 2,881
Same answer as yesterday.
When three objects are welded together and move together they are one object.
Make a graphic of the three objects and place the image in an actor. Then set up the actor with the behaviors that you need for both players to pull the same actor around the scene.
Answers