Unity Asset - Physics Based Tank Controller V1.5

Posted on  by  admin
Unity Asset - Physics Based Tank Controller V1.5 7,6/10 1473 reviews

Hi, I'm trying to get a practical understanding of colliders and rigidbodies in Unity on an example of simplified tank with a turret. Goal: A tank's 'body' that can be driven by Rigidbody.AddForce with a turret that moves and rotates along with it but can be also separately rotated using Rigidbody.AddTorque (separate keys). What I've tried: I've created following structure: Turret and Body entities are exactly the same apart from 'mass' - Body: 5, Turret: 1.

  1. Physics Based Stage Program
  2. Physics Based Fighting Game

Physics Based Tank Controller Testing Web Demo. Tanks in Unity Physics Tank Maker Ver.2.0 [Unity Asset] - Duration: 5:34. Chobiglass 2,511 views.

Jumpstart dumpper v.40.1 free download. Dumpper v.91.2 Dumpper es un software portable y gratuito enfocado a la gestion de redes wireless en Windows. ??? jumpstart dumper ??? ??.

Tank object has two C# scripts attached to itself. Issue: With that kind of setup body can be moved and turret rotated by using physics but those two are independent of each other - when body is moved fast enough the turret will start to slide and finally fall off. I've tried using hinge joints - the turret moves with tank but acts.like a hinge Part of the force, when rotating body, is applied to the turret but not 100%. I could resolve this part with a bit of code but that seems unnecessary, and here is my question: What is the appropriate way of approaching such a task? Should I be using hierarchy of rigidbodies and colliders in different way?

Unity

I'm open to any and all suggestions. Forces work on rigidbodies not individual colliders.

Physics Based Stage Program

Probably the simplest setup here is have a single tank hull that is the rigidbody as suggested. What I would do is the hull is a convex mesh that bounds both your tank model and the turret.

Physics Based Fighting Game

The hull has your rigidbody and you disable it's mesh renderer. Then your visible meshes are children without colliders. And you rotate the turret with Transform.Rotate. If your turret isn't inside the hull and has it's own collider, when you rotate it via Transform.Rotate it's not going to interact correctly if it collides with other objects. Another plus to this approach is you can create hulls that won't easily do things like just run over the top of other objects or tanks. Generally you want physics hulls to not be the models so you have more control over stuff like that.

The downside is details won't collide for the most realistic effect. But it's a good trade off of simplicity vs complexity. Click to expand.I'm trying to rotate/move everything with physics, from what I've understood from tutorials and related materials using Transform.Rotate omits the physics engine and simply applies the transformation to the specified object. Am I right about this one? I can almost achieve my desired behavior using joints (as mentioned in the original post) where I can have two Rigidbodies (hull and turret) that don't collide with each other thanks to joints' option that can disable those for connected objects. Mentioned configurable joint might be the solution for me in this case but unfortunately I haven't been able to configure it properly yet.

Coments are closed