This article's documentation is for anything that uses the Source engine. Click here for more information.

Env viewpunch: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (minoro)
No edit summary
 
(12 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{wrongtitle|title=env_viewpunch}}
{{CD|CEnvViewPunch|file1=1}}
 
{{This is a|logical entity|engine=Source|name=env_viewpunch}} It applies a view punch according to the origin, radius, and angle. Generally, it moves the screen as if the player was "punched".
== Entity description ==
{{note|Players in vehicle are unaffected.}}
Applies a view punch according to the origin, radius, and angle.
{{note|Doesn't seem to work in {{l4d2}}. Using netprop <code>m_Local.m_vecPunchAngle</code> is possible instead}}


== Keyvalues ==
== Keyvalues ==
* {{kv targetname}}
{{KV Targetname}}
* '''radius'''
{{KV|Punch angles|intn=punchangle|angle|The punch angles to apply.}}
:<float> The radius around this entity in which to affect players.
{{KV|Effect Radius|intn=radius|float|The radius around this entity in which to affect players. (0 means all clients)}}
* '''punchangle'''
:<angle> The punch angles to apply.


== Flags ==
== Flags ==
* 1 : Punch all players (ignore radius)
{{fl|1|Punch all players (ignore radius)}}
* 2 : Punch players in the air
{{fl|2|Punch players in the air}}


== Inputs ==
== Inputs ==
* {{i targetname}}
{{I|ViewPunch|Performs the view punch.}}
* '''ViewPunch'''
: Perform the view punch.
 
== Outputs ==
* {{o targetname}}


[[Category:Half-Life 2: Episode One Entities]]
== Convars ==
{{varcom|start}}
{{varcom|sv_suppress_viewpunch|0|bool|Whether the view punch should take effect}}
{{varcom|end}}

Latest revision as of 04:31, 29 April 2025

C++ Class hierarchy
CEnvViewPunch
CPointEntity
CBaseEntity
C++ effects.cpp

env_viewpunch is a logical entity available in all Source Source games. It applies a view punch according to the origin, radius, and angle. Generally, it moves the screen as if the player was "punched".

Note.pngNote:Players in vehicle are unaffected.
Note.pngNote:Doesn't seem to work in Left 4 Dead 2. Using netprop m_Local.m_vecPunchAngle is possible instead

Keyvalues

Name (targetname) <string>[ Edit ]
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

Punch angles (punchangle) <angle>
The punch angles to apply.
Effect Radius (radius) <float>
The radius around this entity in which to affect players. (0 means all clients)

Flags

Punch all players (ignore radius) : [1]
Punch players in the air : [2]

Inputs

ViewPunch
Performs the view punch.

Convars

Cvar/Command Parameters or default value Descriptor Effect
sv_suppress_viewpunch 0 bool Whether the view punch should take effect