How to Make 2 Actors Share an Object
![thatfoolsean](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
Hi,
I am working on a game right now where two different actors (each controlled by a separate player) need to hold either side of log or pole. I have tried a million different ways to have two actors each hold one side of an object, but I cannot figure out how to allow more than one actor to hold an object.
The two actors are each controlled by a different player (players can touch and drag each actor at will). In between these actors is a log, imagine two people who each are holding a very long log. If the players move together, the log moved with them, but if one of them gets far ahead of the other player, they both drop the log.
I have a distance limit that measures when the two players are too fr from each other, and they should drop the log, what I still cannot figure out is how to have each end of the log attached to each of the players, so when they move, the log moves with them.
I know it's probably something simple that I'm missing, but if anyone could help me, I would be greatly appreciative!
Thanks,
Sean
I am working on a game right now where two different actors (each controlled by a separate player) need to hold either side of log or pole. I have tried a million different ways to have two actors each hold one side of an object, but I cannot figure out how to allow more than one actor to hold an object.
The two actors are each controlled by a different player (players can touch and drag each actor at will). In between these actors is a log, imagine two people who each are holding a very long log. If the players move together, the log moved with them, but if one of them gets far ahead of the other player, they both drop the log.
I have a distance limit that measures when the two players are too fr from each other, and they should drop the log, what I still cannot figure out is how to have each end of the log attached to each of the players, so when they move, the log moves with them.
I know it's probably something simple that I'm missing, but if anyone could help me, I would be greatly appreciative!
Thanks,
Sean
Comments
Since We dont know the exact context- creat three actors. One: visable log actor that we see. Two and three are invisible actors on eiither end of the log actor. These could then both be constrained to the log, or have the log constrained to them depending on the goal.
They can then have touch controls independent and have an effect on the log.
To give a little bit of context, the two players are represented by squares, and the log is supposed to be attached to both of them. When they move, the log will move with them, always creating a straight line between the two of them.
The issue I see with your solution is that I cannot figure out how to make sure that each square is attached to the top or bottom of the log, but then is also able to be moved at will by a player, with the log following along.
Have you try to create game attributes to constrain position on the block and to constrain the pipe to those game attributes?..
If this not what you want to achieve, a video would be nice to understand
David
Essentially, the blue square is an actor controlled by Player 1's touch and dragging. The red square is another actor controlled by Player 2's touch and dragging. The white line in the middle represents the "log" they are both holding.
See how when both actors move, the log follows them? I'm faking that right now, but that is the functionality I am trying to achieve. Likewise, I'd like this to extend to turning as well, so that when one actor moves 90 degrees, the log does as well.
Does any of this help? I feel like I'm on the verge of understanding what to do, but I am missing something that is probably elementary!
Sean
http://www.flickr.com/photos/thatfoolsean/