Constrain one Actor to the position of another?
I need to constrain arms and a gun to one actor.
I also need to set it up so that it rotates accordingly with the directional aim button.
Any help?
.
.
.
-----------------------------------------------------
Join the GameSalad Community and have your game noticed for free.
http://www.facebook.com/ListYourTopiPhoneGame
List your Top iPhone Game on FaceBook!
I also need to set it up so that it rotates accordingly with the directional aim button.
Any help?
.
.
.
-----------------------------------------------------
Join the GameSalad Community and have your game noticed for free.
http://www.facebook.com/ListYourTopiPhoneGame
List your Top iPhone Game on FaceBook!
Comments
http://www.youtube.com/user/GameSaladCookbook#p/u/40/JnlxvMlPG-k
Video Title: Constraining one Actor to a specific point on another Actor in iOS games made with GameSalad.
Goes through how to constrain 'wheels' on an actor. Can easily be made into arms/legs/guns, etc...
2)
Rotation will be slightly more tricky, I'd get the first part taken care of, then play with the rotation settings so that it lines up correctly.
Edit: Didn't see your post till I finished posting.
Say you have a player that's body is 50x50, You have a constrain attribute on the body actor of PlayerBodyX and PlayerBodyY. This will be in the middle of the body.
Let's do some arms, legs, and a head:
Head Actor; Let's say your head is 10x10. You'll have 2 constrain attributes on the head actor;
constrain attribute self.position.X to game.PlayerBodyX
constrain attribute self.position.Y to game.PlayerBodyY + 30
Where did I get that 30 from??? If you take the middle of the player body and add 25 to get to the top, then add another 5 for the middle of the player's head you'll get 30. This will place the "Head" actor on top of the body actor.
Now, as you'll notice, we have a LOT of constrain attributes already. We know that Constrain Attribute eats a lot of processor juice so try not to use too many of them.
This should get you started.
Good luck!