How to move an actor around another actor with a joystick like a turret?
ETGgames
Member, PRO Posts: 190
So I'm using the contain x y and rotation to the player and using sin rules and cos rules to constrain it in a fixed position relative to the player. The game is birds eye view. The player can move in all directions with a joystick. I have made another joystick but i want that to control the actor moving around the player's centre. Think of it as a turret rotating around the centre of a tank.
Comments
For a turret on the top of a tank, can't you just rotate the turret with any of the Rotate behaviors and then constrain it's position to the center (or slightly offset center) of the tank actor?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
No because I need the centre of rotation to be on one side of the actor
My Games:
https://itunes.apple.com/us/developer/ethan-sarif-kattan/id825823924
https://play.google.com/store/apps/developer?id=ETG+Ltd.
Website: https://etggames.com
@EthaneusTheGreat - it seems that there are two ways to do this...
Do it the maths way as per this link from @Socks
http://forums.gamesalad.com/discussion/76882/off-centre-pivot-point
or
Just add more 'balancing' empty space to your sprite (to the rear of the turret) until the centre of your sprite is in the same position as the centre/rotation point of your turret.
https://www.dropbox.com/s/h36heko1w47003v/Turret.jpg?dl=0
Yup I did the second one and that works for turret rotation its just the shooting from the end of a turret that i need help on
My Games:
https://itunes.apple.com/us/developer/ethan-sarif-kattan/id825823924
https://play.google.com/store/apps/developer?id=ETG+Ltd.
Website: https://etggames.com
My Games:
https://itunes.apple.com/us/developer/ethan-sarif-kattan/id825823924
https://play.google.com/store/apps/developer?id=ETG+Ltd.
Website: https://etggames.com
see the position the bullet is spawned at is where I'm trying to do this...
My Games:
https://itunes.apple.com/us/developer/ethan-sarif-kattan/id825823924
https://play.google.com/store/apps/developer?id=ETG+Ltd.
Website: https://etggames.com
OMG IM SUCH AN IDIOT!!!! It is simply just changing the x position to say 50 and setting it relative to ACTOR!! wow...two years of game salad and he goes and makes a rookie error..
My Games:
https://itunes.apple.com/us/developer/ethan-sarif-kattan/id825823924
https://play.google.com/store/apps/developer?id=ETG+Ltd.
Website: https://etggames.com