• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Game Mechanics positioning an object always behind another object

J

jaber

Guest
Hi game makers enthusiasts :D
In order to make things looks real, I want the passengers of the armored vehicle to eject behind the vehicle (where I marked the red circle)
I know I have the X and Y of the vehicle and also the angel of it ... I still cant find a mathematical solution how to do that?
Thanks in advance : )
111184515_631702914118389_3072118060261288593_n.jpg
 

NightFrost

Member
The angle of the position is the opposite of vehicle angle (angle + 180 and mod-ed with 360). The position is trigonometry, you can use lengthdir_x and lengthdir_y to find out the coordinates (relative to vehicle centerpoint).

(Also, questions like this belong to programming subforum, not here.)
 
Top