Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

Top down tank, Problem with Turret and camera!!

Archive: 5 posts


Hi guys,

I'm making a top-down, driver/shooter game, and i've got stuck on one piece of logic and i cant figure out what to do.

I've built a tank thing, and it has a gun turret on the back, the logic for the tank is fine, it all drives lovely. i have a game camera on the tank, set to local space, so the camera turns as the tank turns and so the tank is always facing forward. i want the gun turret to rotate to the direction the right analog stick is pointed at. so whatever direction you flick the right stick to the gun aims that way.

so i put a joystick rotator on it and it works fine.........as long as the tank is facing up/north/forward etc. if i drive my tank 90degrees to the right so it is facing east/right, and then press up with the right stick, the gun turret points to the left, which is still north/up, whereas i want 'up' to be whatever way the tanks faces??? there is no way to set the joystick rotator to react to local space??

hopefully ive explained this right, any help with this would be very much appreciated. cheers guys
2013-01-21 14:22:00

Author:
Unknown User


Hmm maybe you could have a circle of holo material with tags for the main cardinals (N, S, E, W) and 4 more for the diagonals (NW, NE, SW, SE), the holo should be glued to the tank's lower body, just make sure to give all of them a name and their own Look At Rotators that will activate depending on player input?

Kinda restricts the aiming system but that's all I can see now, hope it helps
2013-01-21 16:42:00

Author:
Rovelius
Posts: 74


Thanks for the suggestion. gona play around with some holo ideas later. seems strange that Mm have not encountered something like this before with the variety of top-downs there are out there. Pffffft... ha2013-01-21 17:10:00

Author:
Unknown User


Ah, I asked a similar question ages ago and got a great answer from Evret. See this thread (https://lbpcentral.lbp-hub.com/index.php?t=72193-Local-Space-Joystick-Rotator-of-sorts) for a solution to your problem.2013-01-21 17:50:00

Author:
Ostler5000
Posts: 1017


Hmm maybe you could have a circle of holo material with tags for the main cardinals (N, S, E, W) and 4 more for the diagonals (NW, NE, SW, SE), the holo should be glued to the tank's lower body, just make sure to give all of them a name and their own Look At Rotators that will activate depending on player input?

Kinda restricts the aiming system but that's all I can see now, hope it helps

Maybe you can do something like this but if you want to reduce the restriction caused when shooting you might want further points to go in between the diagonals. For instance you could have N, NE, NEE* which would be more accurate.

*NEE would mean North East East, so this is half way between North East and East. Of course, you could divide this up even further but then it becomes more complicated.
2013-01-21 19:07:00

Author:
MSTER232
Posts: 247


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.