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 (This entity is also available in Portal 2 so it's safe to assume it's in every game and not just Hl2 Episode 1)
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{this is a|point 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".
{{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".
{{note|Players in vehicle are unaffected.}}
{{note|Doesn't seem to work in {{l4d2}}. Using netprop <code>m_Local.m_vecPunchAngle</code> is possible instead}}


== Keyvalues ==
== Keyvalues ==
{{KV Targetname}}
{{KV|Punch angles|intn=punchangle|angle|The punch angles to apply.}}
{{KV|Punch angles|intn=punchangle|angle|The punch angles to apply.}}
{{KV|Effect Radius|intn=radius|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)}}
{{KV Targetname}}
{{KV Parentname}}


== 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 ==
{{IO|ViewPunch|Performs the view punch.}}
{{I|ViewPunch|Performs the view punch.}}
{{I Targetname}}
{{I Parentname}}


== Outputs ==
== Convars ==
{{O Targetname}}
{{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