Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Best Way to make tank movement

Discussion in 'Physics' started by Adrielcz, Apr 10, 2021.

  1. Adrielcz


    Aug 5, 2020
    So guys I got a 3d top down project and I got the following requirements to my tank and since I cannot do all of then together I came here for help:
    The tank must move with W,A,S,D but it must be able to pivot or not.
    It must have many colliders, for tracks, for the hull, turret, guns and so on.
    It must have acceleration, fall from heights, detect where the collision come from, like front, side, rear.
    The turret must follow the mouse and accelerate too and if the tank start to climb some obstacles it should not rotate downwards or upwards.
    Should have a moving track (either by track animation or texture swap)
    Any tip or idea would be very much appreciated.
    I already have one model working with some problems:
    It moves by code with fixed speed and rotation (no acceleration), have pivot enabled, if is trespassing obstacles it'll do a weird turret pivot, the turret have a little bug that make it move faster when the mouse is close to the tank.
    Btw, already tried unity vehicle controls such as wheel colliders, since my try got nowhere, this is the best work I got so far.
    I'll post here the code, if you guys ask for any other information I'll bring it here, sorry for the tons of requests, I'm a codding noob and trying to patch together tons of youtube tutorials for my needs. Sorry for the rusty English, I'm a Brazilian dude.

    Attached Files: