Func pendulum: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
Line 13: Line 13:
== Spawnflags ==
== Spawnflags ==
{{fl|1|Start ON}}
{{fl|1|Start ON}}
{{fl|2|Swing|{{confirm|What does this do?}}}}
{{fl|8|Passable}}
{{fl|8|Passable}}
{{fl|16|Auto-return|If this is enabled, it will cause the pendulum to return to the start position when it is triggered. This may produce unexpected results.}}
{{fl|16|Auto-return|If this is enabled, it will cause the pendulum to return to the start position when it is triggered. This may produce unexpected results.}}

Revision as of 14:54, 10 November 2025

Edit Tabs

Stub

This article or section is a stub. You can help by expanding it.

func_pendulum is a brush entity available in Half-Life: Source Half-Life: Source, Garry's Mod Garry's Mod, and Jabroni Brawl: Episode 3 Jabroni Brawl: Episode 3. It creates an object that moves in the manner of a pendulum.

Keyvalues

Name (targetname) <string>
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also: Generic Keyvalues, Inputs and Outputs available to all entities
Pitch Yaw Roll (Y Z X) (angles) <QAngle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
Speed (speed) <float>
Speed at which the pendulum swings, in degrees/second.
Distance (deg) (pendistance) <float>
Maximum distance the pendulum swings, in degrees.
Dampening (0-1000) (damp) <float>
Damage inflicted if blocked (dmg) <float>

Spawnflags

Start ON : [1]
Swing : [2]
Confirm:What does this do?
Passable : [8]
Auto-return : [16]
If this is enabled, it will cause the pendulum to return to the start position when it is triggered. This may produce unexpected results.
X Axis : [64]
Y Axis : [128]

Inputs

Use
Toggle swinging on/off.
Activate
Start swinging, if it isn't already.

FGD code

@SolidClass base(Targetname, Parentname, Origin, Angles, RenderFields, Global) = func_pendulum :
	"A brush entity that swings on an axis like a pendulum."
[
	speed(integer) : "Speed" : 10
	distance(integer) : "Distance (deg)" : 90
	damp(integer) : "Damping (0-1000)" : 0
	dmg(integer) : "Damage inflicted when blocked" : 0
	spawnflags(flags) =
	[
		1: "Start ON" : 0
		8: "Passable" : 0
		16: "Auto-return" : 0
		64: "X Axis" : 0
		128: "Y Axis" : 0
	]

	input Use(void) : "Toggles the swing"
	input Activate(void) : "Starts the swing"
]