Jump to content

How to make a turret tracking a target with IK


Recommended Posts

In this post, I'll show you how to make a turret tracking (or a tracking system with multiple points of rotation), all the blocks placed in this tutorial are here to illustrate and are not necessary.

 

We'll open modelbench to start creating our turret, nothing is needed to be imported.

When opened, we will add 3 or 4 parts to the model :

- a first part I named "turret (don't move)" made to don't break the model and isolate our system

- a second part I named "y rotation" which will be the section tracking left and right (Y=0 obligatory) and parented to "turret (don't move)".

- a third part I named "y axis" which will set the axis (Y=-20, you are kinda free with thiw one as long as it's a negative value)

- a fourth part (optional) I named "turret base" parented to the "y rotation" and used just to add the blocks to decorate as well as changing the rotation more easily

 

The organisation without the "turret base" will look like this :

o1tFRNn.png

The different position and rotation of each new parts :

0gyLDUJ.png nLQdnGX.png

 

Everything is set and we can start to add the IK we will use to track on the Y axis, open the bend section of "y rotation".

Activate the "X axis" and leave the range and default angle as if.

2CK2Oo5.png

Now, we'll go to the end of this section and put the part at "Lower", the "Joint offset" at -1 and the "Joint end" at 1. I choosed "Lower" because our axis is set lower and the "Joint" parameters at -1 and 1 to be sure to don't have weird things happening.

uCO9yaA.png

 

Our first axis is done, we can move to the second axis. For the Z axis, we will duplicate what we just made and modify how it's set in the Elements list.

- I added a part named "cannon" parented to "y rotation" and with a Z rotation at -90° and a Y position at 22 in our case

- "y axis" (I renamed "Z axis") will be parented to the "y rotation" with a X position at 40 in our case and a Y position at 22 (the same Y position used for the "cannon")

- "y rotation" (I renamed "Z rotation") will be parented to "cannon"

- "turret base" (I renamed "cannons" and still optional) is still parented to "Z rotation" and with a Y rotation at 90°

 

In the end, our entire Elements list will look like this :

MxYeZTz.png

The different position and rotation of each new parts :

vXVvoVx.png pmwZ9pK.png ACdE1Cn.png

With the different blocks I added, my turret prototype looke like this :

O09dXpu.png

Legend :

Spoiler

- white blocks = decorations

- black blocks = rotation

- purple blocks = axis

Now, we can save our model and it's done !!

 

Now come the part where I explain you how to use it in Mine-Imator 2.0.0, open MI and load your model in it with a cube or any other object, I used Steve here with a custom rotation point set at 12 (optional). Open the "y rotation" part we added earlier and the "Inverse kinematics" on the "CONSTRAINTS" section.

WIpqZjN.png

We'll then choose the thing we want to track, here Steve, so we set the "Target" on "y axis" to lock the bend and then we set "Angle target" on our Steve.

DZAmxAw.png

We repeat the same steps on the second axis. In the end the "Z rotation" will be set like this :

hOItCef.png

 

And now, you can play with it.

QnaUP83.png

HAVE FUN TAKING DOWN THOSE PESKY LITTLE FLYING THINGS !!! :3

Little tip :

Spoiler

set a positive angle offset on the turret axis, because of "real life physics" to make them more realistic.

A block set in front of the target can also works and you can be more free on the position, as well as having something visible.

Precision :

Spoiler

The "cannon" and "Z axis" parts can be set further to the front ( they need to share the same Y position) to simulate a ringed turret (like for a tank turret or a humvee MG turret).

 

Edited by Aisu Uchibi
precision added
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...