Camera and Gun rotation
I am making a game in which the player uses a tank that has a gun that rotates to the mouse position and can fire bullets that have an arc to their flight path. THIS IS A SIDE SCROLLER kinda like mario.
I am having problems rotating the gun after I move beyond the Initial scene boundaries, because the scene is going to be massive, and I will need to have the camera follow the tank along.
I don't know exactly how to describe it, but the gun will rotate to point to the back of the screen, and if i stop to point the gun forward, the farthest it will move is to point directly upwards. If the tank returns to where the tank starts, the Gun will point to where the mouse is normally.
I don't know what to do about this, so please give me your best solution!
Best Answer
-
Socks London, UK.Posts: 12,822
Point the gun at:
Mouse x + camera origin x
Mouse y + camera origin yYou will need to unlock the gun to access the camera attributes.
Answers
Is there a way to do this without unlocking the instance? I'd rather not have to change the gun in EVERY scene if i make more than 1 level
Your instructions were helpful but i'm asking if there is another way.
Your solution did not work.
Thanks for the feedback