Constrain an actor to another actors angle without rotation??
I have a main actor who faces 0 and I'm trying to constrain his hands to his sides. He is viewed from above so his left hand would need to be locked to his 90 and right hand at 270. The main actor has full 360 degree motion and when he moves the hands stay in place and he rotates. Example: His hands are at 90 and 270 as he faces 0, but when he moves 90 his hands are still at 90 & 270 (basically a hand on his head and one on his foot) What I need is for them to stay at his sides when he goes 0-360. Any help solving this is much appreciated!!
Dan
Dan
Comments
Its a little hard to explain but it is possible to set up actors around another actor and have them stay in sync.
Darren.
Its a good thing I own that AWESOME template (and almost all of DBA's other ones ; )
I took a look inside as I do with all of them and found the answer to my problem. Thanks for leading me in the right direction.
Dan
Any suggestions?
Dan
Im not sure it's an image direction issue that has me stuck. The hands are constrained to the body at the 0 and 180 positions. So when my actor is moving left or right his hands are in front and behind him. When he moves up or down his hands are above and below him. Below is the code Im using.
Actor:
game.playerAngle to self.rotation (game.playerAngle is global Angle)
game.playerx to self.positionx
game.playery to self.positiony
Left Hand:
self.rotation to game.playerAngle
self.positionx to game.playerx +cos( game.PunchysAngle %360)*64
self.positiony to game.playery +sin( game.PunchysAngle %360)*64
Right Hand:
self.rotation to game.playerAngle
self.positionx to game.playerx -cos( game.PunchysAngle %360)*64
self.positiony to game.playery -sin( game.PunchysAngle %360)*64
I really need my players hands to stay at his sides regardless of what angle he is moving in.
Any Ideas?
Left Hand:
self.rotation to game.playerAngle
self.positionx to game.playerx +cos( (game.PunchysAngle+90) %360)*64
self.positiony to game.playery +sin( (game.PunchysAngle+90) %360)*64
Right Hand:
self.rotation to game.playerAngle
self.positionx to game.playerx +cos(( game.PunchysAngle+270) %360)*64
self.positiony to game.playery +sin(( game.PunchysAngle+270) %360)*64