Prop dynamic
From Valve Developer Community
This point-based entity is available in all Source games.
| Table of contents |
Entity description
A prop that can be placed in hierarchy and can play animations. It can also be configured to break when it takes enough damage. Note that the health of the object will be overridden by the health inside the model, to ensure consistent health game-wide. If the model used by the prop is configured to be used as a prop_physics (i.e. it should be physically simulated) then it can not be used as a prop_dynamic. Upon level load it will display a warning in the console and remove itself. Use a prop_physics or prop_dynamic_override instead.
Notes
This entity cannot be moved on its own. However, it can be parented to a moving object such as a func_physbox.
For example, if you wanted to make the butcher knife in the props_lab folder into a knife you can actually pick up, you can create it as a prop_dynamic entity and parent it to an invisible func_physbox.
Modelled buttons can be used by covering a prop_dynamic button with a func_button, and then targeting the prop_dynamic with the SetAnimation input.
Levers can be used by covering a prop_dynamic with a func_rot_button. Parent the prop_dynamic to the func_rot_button.
Valves can be created by using a prop_dynamic with a valve model and covering the prop_dynamic with momentary_rot_button. Parent the prop_dynamic to the momentary_rot_button.
- See also Prop Types Overview
- See also Prop Footsteps - A tutorial that provides essential code for when players walk on entities like this, it's not ignored during footstep sound computation.
Keyvalues
- targetname <target_source>
- Defines the name that other entities refer to this entity by.
- hammerid [Episode Two Update]
- <integer readonly> This id is used for debugging purposes in Hammer.
- Pitch Yaw Roll (Y Z X)
- This entity's angular orientation in the world (also used for angular effect entities).
- fademindist
- <float> Start Fade Dist/Pixels - Distance at which the prop starts to fade. (-1 = Use fademaxdist.)
Note: If this entity is in a 3D Skybox, this value will automatically be scaled properly.
- fademaxdist
- <float> End Fade Dist/Pixels - Max fade distance at which the prop is visible. (0 = Don't fade out.)
Note: If this entity is in a 3D Skybox, this value will automatically be scaled properly.
- fadescale
- <float> Fade Scale - If you specify a fade in the worldspawn, or if the engine is running under dx7, the engine will forcibly fade out props even if fademindist/fademaxdist isn't specified. This scale factor gives you some control over the fade. Using 0 here turns off the forcible fades. Numbers smaller than 1 cause the prop to fade out at further distances, and greater than 1 cause it to fade out at closer distances.
- DefaultAnim
- <string> The name of the idle animation that this prop will revert to whenever it finishes a random or forced animation.
- RandomAnimation
- <choices> Randomly Animate.
Literal value Description 0 No 1 Yes
- MinAnimTime
- <float> Minimum time between random animations.
- MaxAnimTime
- <float> Maximum time between random animations.
- model
- <studio> World Model (Maximum string length: 128)
- skin
- <integer> Some models have multiple versions of their textures called skins. Set this to a number other than 0 to use that skin instead of the default.
- disableshadows
- <boolean> Used to disable dynamic shadow casting from this entity.
- SetBodyGroup
- <integer> Initial Bodygroup Setting
- damagefilter <target_destination>
- Name of the filter_damage_type entity that controls which entities can damage us.
- ExplodeDamage <float>
- If non-zero, when this entity breaks it will create an explosion that causes the specified amount of damage. See also 'Explosion Radius'.
- ExplodeRadius <float>
- If non-zero, when this entity breaks it will create an explosion with a radius of the specified amount. See also 'Explosion Damage'.
- PerformanceMode <choices>
- Used to limit the amount of gibs produced when this entity breaks, for performance reasons.
Literal Value Description 0 Normal 1 Limit Gibs 2 Full Gibs on All Platforms
- pressuredelay <float>
- Delay, in seconds, after 'broken' by pressure before breaking apart (allows for sound to play before breaking apart).
- mindxlevel
- <choices> Minimum DX Level
Literal Value Description 0 default (lowest) 70 dx7
- maxdxlevel
- <choices> Maximum DX Level
Literal Value Description 0 default (lowest) 60 dx6
- parentname <target_destination>
- Specifies the targetname of this entity's Parent in a movement hierarchy. Child entities move with their Parent.
- globalname
- <string> Name by which this entity is linked to another entity in a different map. When the player transitions to a new map, entities in the new map with globalnames matching entities in the previous map will have the previous map's state copied over their state.
- StartDisabled
- <boolean>
- solid
- <choices> Collisions.
Literal value Description 0 Not Solid 2 Use Bounding Box 6 Use VPhysics
Flags
- 16 : Break on Touch
- 32 : Break on Pressure
- 64 : Use Hitboxes for Renderbox
Inputs
- SetParent <target_destination>
- Changes the entity's parent in the movement hierarchy.
- SetParentAttachment <string>
- Change this entity to attach to a specific attachment point on its parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment.
- SetParentAttachmentMaintainOffset <string> [Episode One Update]
- Change this entity to attach to a specific attachment point on it's parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment. The entity will maintain it's position relative to the Parent's Origin and Angles at the time it is attached.
- Removes this entity from its current movement hierarchy.
- Skin <integer>
- Changes the model skin to the specified number.
- SetBodyGroup <integer>
- Set this prop's body group (from 0 - n). Changes the model body to the specified number.
- DisableShadow
- Turn shadow off.
- EnableShadow
- Turn shadow on.
- AlternativeSorting <bool> [Episode One Update]
- Used to attempt to fix sorting problems when rendering. True activates, false deactivates
- Enable
- Enable this entity.
- Disable
- Disable this entity.
- SetAnimation <string>
- Force the prop to play an animation. The parameter should be the name of the animation.
- SetDefaultAnimation <string>
- Set the default animation (DefaultAnim) to the one specified in the parameter."
- SetBodyGroup <integer>
- Set the visible bodygroup, by index.
- TurnOn
- Make the prop visible.
- TurnOff
- Make the prop invisible.
Outputs
- OnIgnite
- Fired when this object catches fire.
- OnAnimationBegun
- Fired whenever a new animation has begun playing.
- OnAnimationDone
- Fired whenever an animation is complete.
- OnOutOfWorld
- Fired whenever the entity leaves map boundaries.
