In this post will teach you how to move objects using func_movelinear. This can be used to create many things like; cranes, lifts, moving props that do not have an animation and other things. If you want to use a vehicle prop, then I recommend you check if the prop has animation first. If not then use func_tanktrain. Which I will cover later on.

For purpose of the this demonstration, I will be using func_movelinear to create a crane. For this you will need;

  • A prop_dynamic prop
  • A Brush with the invisible Texture applied.

Lets start with by selecting the Entity Tools and Filter for prop_dynamic in the Objects dropdownlist. Left-Click in the world to add the entity. Double click the entity to open the properties, and under World Model select the Browse button to open the Model Browser.

In the model browser filter for ‘Crane’ and select the first one by double clicking on it (de_nuke\craneb.mdl). Once you have it selected, hit Apply.

crane

Now we move on to creating a the brush. First select the invisible texture by clicking the Browse button at the right side of the hammer editor to open the Textures window. Use ‘invisible’ in the filter and double click the invisible texture.

invi

Now select the Block Tool and create a template the covers top part of the crane prop. Then hit enter to create brush.  Like so;

crane2

You can resize the brush if you like to only cover small part of the crane. Just make sure that brush is at the centre of the prop. In the end it is up to you, either way you will require to parent the crane to the brush.

crane3

Select the brush and hit Crtl+T to open the object properties because we will want to tie to an entity func_movelinear to the brush. Filter the class dropdownlist for func_movelinear and hit apply

movelinear

Give the brush entity a name (e.g. crane1). The properties that you will need to take into account are;

  • Speed – Speed the brush moves.
  • Move Distance – Distance the you want to brush to move.
  • Move Direction – The direction you want the brush to move.

Speed can be set easily, lower the value the slower it will move.

To identify the direction you want the brush to move, you will need to select Move Direction field and use the top viewport to find the right direction. From the image below you will notice that default move direction is set to the right (identified by the red arrow) but we want the crane to move in upper direction (green).

direction

To do this select Move Direction and direct the hinge up, like so;

direction2

Distance is simple but it requires come calculation. Distance is amount grid squares the brush will have to travel. To calculate it, look at the top viewport and drag a template from where the brush starts to where you want the brush to end, like so;

distance

The value in the red rectangle is the distance.

Only thing left to do is open up the prop_dynamic properties and set its parent value to equal the brush name (crane1).

Here is test video from one of my maps, where I use metal blocks to activate the crane forward and backwards;

Leave a comment