Constrain one actor to a specific spot on another, moving actor
I am working on a game where the player character is made up of several actors constrained to a hitbox (legs, body, head, arm, arm). The hitbox spawns them into the game and they are constrained relatively using a global attribute that tracks the hitbox's position.
One arm is basically just a gun and will not have to move. The other arm is causing me problems.
The way my partner (the artist) has envisioned this is that one arm is always "up" - the gun arm. The other carries a melee weapon of some sort (in this case, a sword) and is able to be swung independently.
I was able to successfully constrain the sword to where the hand would be, but once I tried making the arm rotate as part of a walk-cycle I realized my implementation is broken (as is the arm rotation, but I know how to fix that one).
How do I constrain my sword actor to end (the "hand") of the arm actor, rotating by the same amount when the arm moves?
Comments
@Spalding004 have a look at this thread http://forums.gamesalad.com/discussion/38105/constraining-1-actor-to-another-while-both-rotate-in-sync-with-each-other
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
The answer is quite straightforward, but not very intuitive and involves a little bit of trigonometry - but to save you time I made a machine that works it out for you.
http://forums.gamesalad.com/discussion/62202/linkmachine
. . .
That is extremely helpful!
Mr. Socks also has a handy articulating arm demo.
http://forums.gamesalad.com/discussion/comment/435962/#Comment_435962