How to use func_pendulum
By fizscy46, edited by Egir Helgrimson
I thought I'd write a little tutorial since a lot of people tend to have trouble getting this entity to work. Hazaa! (Note, I bypassed saying aboot as I normally do)
Have you ever wandered through half-life, and noticed those dangling things that swayed to and fro... No, I'm talking about those wires and light fixtures.
This effect is rather simple to set up, but it takes a bit of explaining to get you started.
First of all, the full goodness of a swinging item can only be achieved on
SIMPLE things. Don't even bother trying to make a swinging sphere or cylinder, or any other no rectangular brush, ause it won't turn out perfect.
Quote:
By Egir:
Actually, if all faces on the brushes you want to use are parrallel with the rotation axis or if their normals are, you won't be having any problems
First of all, make your dangling swinging thing. Just make it facing straight down.

Now, decide the
angle that you want it to swing. By this I mean, from which angle should it start swinging? Maybe start at a
45 degree angle and do a full swoop down and back up to
45 degrees on the other side (For a swinging axe maybe). Or, do you want it to just dangle and sway lightly at
3 or
6 degrees (Like those wires in half-life)?
Decide where the
pivot is. The
pivot is the point that it swings around. On a swingset (Which I will use as an example throughout), the top bar is the pivot.

At this location, make a cubed
origin (Brush covered with the
origin texture) brush that has its centre on this point.

Now, have you decided your
angle? Look at the swing object from the 2D view window in which you could watch it swing around (On a swingset, this would be from its side, as you can watch the swing go back and forth and up and down as if it was a flat image). Look at the letters at the top left of this view. Whichever of the 3 axis (
X,Y,Z) isn't there is the pivot axis. Select the object and origin brush, and press
Ctrl +
M to bring up the transform tool. in the textbox labelled with the pivot axis, rotate it the angle from straight down that you want it to start at (If you want it to start swinging from
22.5degrees, put
22.5 in).

Select OK once you typed it in. Its because of this part that the object cannot be complex as vertice coordinates may be rounded and thus cause malformed brush faces. Make sure you move the objects pivot back to its correct position.
Select the origin brush and the swinging object again, and press
Ctrl +
T to make it an
entity. Select your newly formed masterpiece, and press
Alt +
Enter to bring its properties up.

From the pull down list in the window at the top, select
func_pendulum. Remember that
angle you just rotated it?
Double it and make it a negative number! Put this under the
Distance (Deg) box. This will make it swing from the angle its at, down to straight down, then back up on the other side to the same angle.
Now under the flags, check either the
X-Axis or
Y-Axis flag if your
pivot axis was one of those 2 (If it was on the Z-axis, check niether of them). Check
passable to make it non-solid, check
Start On too... make it start on.
(Egir needed slightly other settings for his example)

Back to the Class Info tab:
Give it a
name to make it turn on and off when triggered. give it a
speed (About
10 for a swaying wire; higher for faster object).
Dampning is useful for many instances of this entity. It slows it down by its value out of
1000 each full swing until it stops at the centre point (In our case, straight down). If you want your object to swing forever, set this to
0, however, if you get into more complex uses of this entities (Such as maybe a breaking rope bridge), you'd set this to a very high value (Maybe
750).
So basically thats it. I know this was confusing, perhaps egir will add pictures to it (edit: perhaps), I don't really the initiative to make them and upload them and everything.
Quote:
And this is how it looks ingame (1.5mb heavy download from an animated gif):
