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

Prop dynamic: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (alelcnada)
(Scaled props lose physics in gmod -- bug. Would be better to write it under the model scale KV, but since it's a template, gotta write it in the beginning...)
 
(75 intermediate revisions by 27 users not shown)
Line 1: Line 1:
[http://marinduque.gov.ph/smf/attachments/images/article301.htm what its like to die] [http://i-sniper.com/store/images/46/page-1985.html state maps] [http://uniqueconceptsspa.com/specials/Files/47.htm strange duck] [http://freepublictransit.org/wwdems/ml/attachments/images/page1333.html sierra model] [http://fineartfilm.com/images/watermark/icons/2244.html latino radio spots] [http://i-sniper.com/store/images/46/page-1002.html command and conquer generals] [http://hippoworks.com//12all/admin/attach/files/topic2015.htm metal halide] [http://www.appliedseo.com/wp-content/backup-fbdb4/sql/olosakof.html murad cosmetics] [http://linksinventory.com/temp/templates/cache/text-2029.html saddleman] [http://marukadod.com/main/nse/csv/text1600.htm management games download] [http://www.appliedseo.com/wp-content/backup-fbdb4/sql/ouzart.html rubber tired loaders] [http://media514.com/editionsblocnotes/cache/temp/new1065.htm poker set] [http://emilieheymans.ca/news/data/backup/sql/comment-2263.htm wildlife cameras] [http://hippoworks.com//12all/admin/attach/files/topic425.htm afi davey havok] [http://paramedicweb.info/ftp_uploads/screenshots/image/text-1620.html crochet books] [http://beach-candids.com/sitedepth/_assets/css/css/trocvar-2227.html juvenile rehabilitation] [http://emilieheymans.ca/news/data/backup/sql/comment-1555.htm los angeles daily news] [http://media514.com/editionsblocnotes/cache/temp/new519.htm prom shoes] [http://emilieheymans.ca/news/data/backup/sql/comment-254.htm mycd] [http://neriwonda.com/files/pictures/pics/comment-677.html gap maternity] [http://uniqueconceptsspa.com/specials/Files/782.htm muscial instruments] [http://i-sniper.com/store/images/46/page-44.html t string] [http://linksinventory.com/temp/templates/cache/text-1775.html artworks famous] [http://neriwonda.com/files/pictures/pics/comment-681.html exotic golf carts] [http://chong.org.uk/amyyee/data/media/img/article1465.html big mama] [http://leskratch.com/form/use/Miss/comment1374.htm tax free allowance 2005] [http://multimedia247.com/billing/app-modernbill-order/files/resource-210.html disneyworld vacation rental homes] [http://i-sniper.com/store/images/46/page-1519.html latin dance] [http://beach-candids.com/sitedepth/_assets/css/css/wlofev-1043.html dvd copying software] [http://media514.com/editionsblocnotes/cache/temp/new1134.htm www microsoft com education lessonplans] [http://forgoodnesssake-green.com/commerce/images/news/topic-957.html nombre para bebes.com] [http://dbs-83.net/photos.bkp/plugins/urls/news-468.html live image streams in microsoft internet] [http://linksinventory.com/temp/templates/cache/text-1119.html know] [http://cross-stitch4you.ca/startpages/test/scripts/article-904.htm peek through the keyhole] [http://barrowhabitat.org/public_ftp/incoming/notes/page-1870.html longitudinal studies and] [http://cross-stitch4you.ca/startpages/test/scripts/article-289.htm toe goz] [http://dbs-83.net/photos.bkp/plugins/urls/news-286.html secured transactions outline] [http://emilieheymans.ca/news/data/backup/sql/comment-1655.htm saps effect] [http://chong.org.uk/amyyee/data/media/img/article333.html angel investor] [http://inko9nito.com/portfolio/upgrade/locale/su/reldecouq2489.htm lil jon and the east side boys] [http://barrowhabitat.org/public_ftp/incoming/notes/page-1206.html paul brenner md] [http://rickmay.com/wp-content/uploads/2007/neroeltre.htm tweeters] [http://forgoodnesssake-green.com/commerce/images/news/topic-1581.html ncircle toronto] [http://hippoworks.com//12all/admin/attach/files/topic1362.htm beth] [http://marinduque.gov.ph/smf/attachments/images/article1244.htm lymphoblastic lukemia] [http://marinduque.gov.ph/smf/attachments/images/article1905.htm mike shinodas] [http://ecotribeonline.com/forms/use/intext/sitemap.html here] [http://paramedicweb.info/ftp_uploads/screenshots/image/text-377.html israel population statistics] [http://lonepixel.com/wp-content/uploads/2007/fireboca-481.html cotten eye joe] [http://rickmay.com/wp-content/uploads/2007/loracwca.htm seal rite door] [http://barrowhabitat.org/public_ftp/incoming/notes/page-1338.html slava site myspace.com] [http://freepublictransit.org/wwdems/ml/attachments/images/page61.html preschool finger puppets] [http://i-sniper.com/store/images/46/page-683.html discount glass vases] [http://paramedicweb.info/ftp_uploads/screenshots/image/text-1663.html jes] [http://multimedia247.com/billing/app-modernbill-order/files/resource-1065.html 2 in nicaragua war world] [http://barrowhabitat.org/public_ftp/incoming/notes/page-1445.html men swimwear] [http://gilbertpaquette.org/news/data/upimages/img/celbasac.html beading supply] [http://chong.org.uk/amyyee/data/media/img/article1336.html airline manila reservation ticket] [http://neriwonda.com/files/pictures/pics/comment-1117.html branson stage shows] [http://inko9nito.com/portfolio/upgrade/locale/su/bockoreli910.htm portuguese bull fighting] [http://chong.org.uk/amyyee/data/media/img/article685.html avenue d] [http://macquaker.org/blog/wp-content/uploads/2006/page-131.html burners] [http://rickmay.com/wp-content/uploads/2007/ricqua.htm cheap dvds] [http://hippoworks.com//12all/admin/attach/files/topic1649.htm creative services] [http://hippoworks.com//12all/admin/attach/files/topic1371.htm briana banks nude free] [http://chong.org.uk/amyyee/data/media/img/article1291.html sewage pump] [http://lonepixel.com/wp-content/uploads/2007/fudombo-487.html local newspaper obituaries] [http://sk8springfield.com/guestbook/templates/scripts/news-1092-20080502.html rsv] [http://marukadod.com/main/nse/csv/text1351.htm sims 2 code for money] [http://macquaker.org/blog/wp-content/uploads/2006/page-241.html itz cash] [http://gravityservices.co.uk/demo/images/thumbs/page-1116.html 3 paper buildings london] [http://leskratch.com/form/use/Miss/comment1453.htm remax commercial brokerage] [http://www.appliedseo.com/wp-content/backup-fbdb4/sql/monhenf.html ecology phenomenological] [http://sk8springfield.com/guestbook/templates/scripts/news-979-20080425.html isosorbide side effects] [http://paramedicweb.info/ftp_uploads/screenshots/image/text-1624.html earthcam] [http://i-sniper.com/store/images/46/page-377.html mentors on a mission] [http://gravityservices.co.uk/demo/images/thumbs/index.html more] [http://emilieheymans.ca/news/data/backup/sql/comment-1345.htm saddlebred source] [http://beach-candids.com/sitedepth/_assets/css/css/safigoln-2581.html m drowning slowly] [http://i-sniper.com/store/images/46/page-672.html death metal] [http://leskratch.com/form/use/Miss/comment1088.htm josh groban remember] [http://linksinventory.com/temp/templates/cache/text-1554.html membrane wine press] [http://beach-candids.com/sitedepth/_assets/css/css/acelgetx-315.html bikini atoll] [http://emilieheymans.ca/news/data/backup/sql/comment-401.htm earl b. larkin] [http://chong.org.uk/amyyee/data/media/img/article1534.html soccer chicks] [http://inko9nito.com/portfolio/upgrade/locale/su/elzarno415.htm custom embroidered product] [http://hippoworks.com//12all/admin/attach/files/topic1203.htm online art] [http://multimedia247.com/billing/app-modernbill-order/files/resource-2173.html application illinois secretary state title] [http://beach-candids.com/sitedepth/_assets/css/css/boctrcob-1802.html agency canada income revenue tax] [http://www.appliedseo.com/wp-content/backup-fbdb4/sql/fudetrac.html dilaudid] [http://fineartfilm.com/images/watermark/icons/2216.html miami zoning laws] [http://marinduque.gov.ph/smf/attachments/images/article1078.htm top ten country hit] [http://i-sniper.com/store/images/46/page-472.html japanese colonization korea] [http://beach-candids.com/sitedepth/_assets/css/css/racvarlet-317.html flood insurance arizona] [http://barrowhabitat.org/public_ftp/incoming/notes/page-291.html under the table jobs] [http://gravityservices.co.uk/demo/images/thumbs/page-522.html lake tahoe condos] [http://ecotribeonline.com/forms/use/intext/news-749.html carleton document storage] [http://media514.com/editionsblocnotes/cache/temp/new1112.htm subwoofer review best subwoofer] [http://freepublictransit.org/wwdems/ml/attachments/images/page755.html 3d archiving] [http://emilieheymans.ca/news/data/backup/sql/comment-405.htm gargoyle tattoos] [http://cross-stitch4you.ca/startpages/test/scripts/article-1925.htm ring blower] [http://cross-stitch4you.ca/startpages/test/scripts/article-857.htm almirante hotel alicante] [http://cross-stitch4you.ca/startpages/test/scripts/article-1200.htm labor relations consultant] [http://uniqueconceptsspa.com/specials/Files/1417.htm exotic encounters] [http://uniqueconceptsspa.com/specials/Files/sitemap.htm map] [http://uniqueconceptsspa.com/specials/Files/687.htm elizabeth ann hilden] [http://marinduque.gov.ph/smf/attachments/images/article2324.htm childrens lamps] [http://marinduque.gov.ph/smf/attachments/images/article905.htm thermography] [http://www.appliedseo.com/wp-content/backup-fbdb4/sql/paslet.html raw food recipe] [http://ecotribeonline.com/forms/use/intext/news-1406.html aa.com admiralsclub] [http://beach-candids.com/sitedepth/_assets/css/css/mexcsedmo-2385.html network manager job description] [http://chong.org.uk/amyyee/data/media/img/article1660.html atv extreme] [http://rickmay.com/wp-content/uploads/2007/droninfu.htm female wet pants] [http://gilbertpaquette.org/news/data/upimages/img/lifizarfe.html atv plows] [http://gravityservices.co.uk/demo/images/thumbs/page-842.html personalized license plate frames] [http://beach-candids.com/sitedepth/_assets/css/css/hengold-2365.html infectious disease jobs] [http://gilbertpaquette.org/news/data/upimages/img/riccacaqa.html anna nalick breathe] [http://barrowhabitat.org/public_ftp/incoming/notes/page-1961.html summer camp position] [http://forgoodnesssake-green.com/commerce/images/news/topic-1052.html tub shower faucets] [http://marinduque.gov.ph/smf/attachments/images/article1605.htm travel package] [http://media514.com/editionsblocnotes/cache/temp/new1166.htm address management software] [http://multimedia247.com/billing/app-modernbill-order/files/resource-2213.html the brickskeller dc] [http://gilbertpaquette.org/news/data/upimages/img/quarolcfo.html apartment birmingham michigan rental] [http://chong.org.uk/amyyee/data/media/img/article750.html hp 45] [http://neriwonda.com/files/pictures/pics/comment-1012.html aya matsuura pictures] [http://chong.org.uk/amyyee/data/media/img/article1421.html 3 phase electrical circuit] [http://freepublictransit.org/wwdems/ml/attachments/images/page1136.html eostar] [http://i-sniper.com/store/images/46/page-1305.html peugeot 605] [http://www.appliedseo.com/wp-content/backup-fbdb4/sql/rolcofio.html sesso] [http://dbs-83.net/photos.bkp/plugins/urls/news-1713.html just eat it] [http://macquaker.org/blog/wp-content/uploads/2006/page-1654.html wholesale computer product] [http://fineartfilm.com/images/watermark/icons/1654.html tara emory] [http://cross-stitch4you.ca/startpages/test/scripts/article-1817.htm organize toys ideas] [http://sk8springfield.com/guestbook/templates/scripts/news-1607-20080429.html anouk one word] [http://sk8springfield.com/guestbook/templates/scripts/index.html top] [http://barrowhabitat.org/public_ftp/incoming/notes/page-1304.html american society of gastroenterologist] [http://dbs-83.net/photos.bkp/plugins/urls/news-757.html short homecoming dresses] [http://lonepixel.com/wp-content/uploads/2007/viricvi-308.html acc center for non] [http://sk8springfield.com/guestbook/templates/scripts/news-818-20080501.html omega travel agent london] [http://multimedia247.com/billing/app-modernbill-order/files/resource-1107.html miami wedding bands] [http://macquaker.org/blog/wp-content/uploads/2006/page-1101.html one man band] [http://chetty.mu/blog/content/07/02/sedvitac-701.html hard drive mechanic gold] [http://beach-candids.com/sitedepth/_assets/css/css/relhenbos-2061.html condo in the cayman islands] [http://inko9nito.com/portfolio/upgrade/locale/su/eltolo1701.htm rubber label] [http://forgoodnesssake-green.com/commerce/images/news/topic-436.html nun sex nude] [http://lonepixel.com/wp-content/uploads/2007/monxviri-941.html tatty bear] [http://emilieheymans.ca/news/data/backup/sql/comment-1955.htm kef corelli] [http://marukadod.com/main/nse/csv/text2118.htm thoughtless evanescence] [http://i-sniper.com/store/images/46/page-891.html curious george crib bedding] [http://ecotribeonline.com/forms/use/intext/news-658.html san diego lodging] [http://freepublictransit.org/wwdems/ml/attachments/images/page550.html players by the sea jacksonville] [http://freepublictransit.org/wwdems/ml/attachments/images/page968.html american comic] [http://gravityservices.co.uk/demo/images/thumbs/page-12.html cartoon men] [http://beach-candids.com/sitedepth/_assets/css/css/delrol-1258.html grease guns] [http://multimedia247.com/billing/app-modernbill-order/files/index.html top] [http://fineartfilm.com/images/watermark/icons/406.html norwegian kelp] [http://chetty.mu/blog/content/07/02/sitqasgo-442.html zeven germany] [http://freepublictransit.org/wwdems/ml/attachments/images/page713.html australian grass tree] [http://forgoodnesssake-green.com/commerce/images/news/topic-1020.html body shop equipment] [http://i-sniper.com/store/images/46/page-1234.html video remote interpreting] [http://inko9nito.com/portfolio/upgrade/locale/su/chibase17.htm preschool handwriting worksheets] [http://gilbertpaquette.org/news/data/upimages/img/roldex.html washington dc national gallery of art] [http://marinduque.gov.ph/smf/attachments/images/article985.htm epiplexis] [http://gilbertpaquette.org/news/data/upimages/img/colawrer.html lyric and 21st century schizoid man] [http://forgoodnesssake-green.com/commerce/images/news/topic-953.html ballard designs] [http://ecotribeonline.com/forms/use/intext/news-1105.html monroes] [http://sk8springfield.com/guestbook/templates/scripts/news-61-20080427.html bisquick] [http://cross-stitch4you.ca/startpages/test/scripts/article-1089.htm lirr monthly fares] [http://freepublictransit.org/wwdems/ml/attachments/images/page886.html the life dvd review] [http://hippoworks.com//12all/admin/attach/files/topic236.htm paducah sun] [http://chetty.mu/blog/content/07/02/erchiqasb-881.html argonaut hotel fishermans wharf a kimpton hotel] [http://chong.org.uk/amyyee/data/media/img/article1981.html mondrian language] [http://leskratch.com/form/use/Miss/comment1701.htm skill shortage] [http://rickmay.com/wp-content/uploads/2007/sitemap.htm sitemap] [http://emilieheymans.ca/news/data/backup/sql/comment-1497.htm awanas heart texas] [http://sk8springfield.com/guestbook/templates/scripts/news-605-20080422.html vgn b100b07] [http://neriwonda.com/files/pictures/pics/comment-1171.html teen program] [http://paramedicweb.info/ftp_uploads/screenshots/image/text-1914.html equipment lease] [http://cross-stitch4you.ca/startpages/test/scripts/article-953.htm anal couple married sex] [http://marukadod.com/main/nse/csv/text2664.htm so beautiful] [http://dbs-83.net/photos.bkp/plugins/urls/news-2391.html billet wheels] [http://marinduque.gov.ph/smf/attachments/images/article2262.htm referrible] [http://barrowhabitat.org/public_ftp/incoming/notes/page-2242.html nutritional information on couscous] [http://dbs-83.net/photos.bkp/plugins/urls/news-843.html picking wildflowers] [http://cross-stitch4you.ca/startpages/test/scripts/article-1512.htm trophic levels] [http://cross-stitch4you.ca/startpages/test/scripts/article-2.htm chicago neighborhoods] [http://multimedia247.com/billing/app-modernbill-order/files/resource-703.html japanese tattoo symbols] [http://neriwonda.com/files/pictures/pics/comment-1046.html jackson michael soundboard] [http://barrowhabitat.org/public_ftp/incoming/notes/page-1296.html bad credit mastercard] [http://emilieheymans.ca/news/data/backup/sql/comment-2414.htm obsession lyrics] [http://marukadod.com/main/nse/csv/text433.htm pasadena paseo apartments] [http://inko9nito.com/portfolio/upgrade/locale/su/ouroeretz301.htm logazou] [http://barrowhabitat.org/public_ftp/incoming/notes/sitemap.html link] [http://marinduque.gov.ph/smf/attachments/images/article2583.htm watermelon facts] [http://i-sniper.com/store/images/46/page-1786.html media player default player] [http://sk8springfield.com/guestbook/templates/scripts/news-128-20080428.html pre-fab homes] [http://freepublictransit.org/wwdems/ml/attachments/images/page1718.html muscular military men] [http://rickmay.com/wp-content/uploads/2007/neindr.htm tetons] [http://marukadod.com/main/nse/csv/text1857.htm amber campisis pictures] [http://sk8springfield.com/guestbook/templates/scripts/news-748-20080422.html san diego home]
{{LanguageBar}}
{{wrongtitle|title=prop_dynamic}}
{{CD|CDynamicProp|file1=props.cpp}}
{{base_point}}
{{this is a|model entity|name=prop_dynamic}} It is used to add a [[model]] to the world that can [[Skeletal animation|animate]] itself.


== Entity description ==
{{tip|If your model is never going to move and/or requires more detailed lighting, consider using {{ent|prop_static}} (which is [[cheap]]er).}}
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 ===
{{note|To enforce consistency, models with [[prop_data|embedded physics data]] cannot by default be used by <code>prop_dynamic</code>. Use the Hammer model browser's [[:Image:Model_info.gif|Info tab]] to check for support. If you intend to use a physics model in non-physics role, use {{ent|prop_dynamic_override}}.}}
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.
{{bug|tested={{Gmod}}|Scaling a prop_dynamic disables its physics collisions.}}


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.
{{altnames|name1=dynamic_prop|misc=The classname is always changed to <code>prop_dynamic</code> on spawn.}}


Levers can be used by covering a prop_dynamic with a [[func_rot_button]]. Parent the prop_dynamic to the func_rot_button.
== Uses ==
*'''Buttons''' can be created by parenting a <code>prop_dynamic</code> to a {{ent|func_button}} brush. This will cause <code>+use</code> inputs on the prop to be forwarded to the {{ent|func_button}}, which can be placed anywhere in the map (or even outside the map, [[Leak|as long as the origin, if present, is inside]]). The <code>SetAnimation</code> input can then be used to make the prop animate when interacted with.
:* In {{mapbase|2}}, {{ent|prop_interactable|game=Mapbase}} combines these entities, making setup easier. Likewise, {{vtmb|2}} has {{ent|prop_button|game=Vampire The Masquerade - Bloodlines}}.
*Similarly, '''levers''' can be created by parenting a <code>prop_dynamic</code> to a {{ent|func_rot_button}} (or {{ent|momentary_rot_button}}) brush. No animation is needed for this - the brush will rotate the prop by itself. As before, the entity can be placed anywhere, as long as the origin is positioned at the point you want it to rotate around.
*A <code>prop_dynamic</code> can be configured to '''break apart''' after receiving damage or on cue by using the <code>Break</code> input. {{note|Health set [[prop_data|inside the model]] will intentionally override health set in Hammer! Use {{ent|prop_dynamic_override}} instead if this is an issue.}}


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.
== Keyvalues ==
{{KV Targetname}}
{{KV|Default Animation|intn=DefaultAnim|string|The animation this prop will play when not doing a random or forced animation.}}
{{KV|Randomly Animate|intn=RandomAnimation|bool|Makes the prop randomly select and play animations at intervals defined by the '''Min/Max Random Anim Time''' KVs. In between the random animations, it will revert to playing '''Default Animation'''.{{note|Will only select from animation [[$sequence]]s linked with <code>ACT_IDLE</code> if they exist.}}}}
{{KV|Min Random Anim Time|intn=MinAnimTime|float|Minimum time between random animations.}}
{{KV|Max Random Anim Time|intn=MaxAnimTime|float|Maximum time between random animations.}}
{{KV|Collisions|intn=solid|integer choices|How the prop should interact with other objects.
:* 0 -  Not solid
:* 2 - Use bounding box
:* 6 - Use [[VPhysics]] (default)}}
{{KV|Update children|intn=updatechildren|bool|since={{l4d}}|Update touches for any children that are attached to attachment points as this prop animates. This allows SetParentAttached triggers or func_brushes to touch properly.}}
{{KV|Disable Bone Followers|intn=DisableBoneFollowers|boolean|since={{Source 2009}}|Disables generation of {{ent|phys_bone_follower}}s for each convex piece the model has in its [[collision model]]. <code>phys_bone_follower</code>s can quickly eat up the [[entity limit|edict count]], so this keyvalue can be very helpful in freeing resources. This will however make the collision model no longer function (the model will be nonsolid to anything that uses the collision model instead of the [[hitbox]]{{elaborate}}). No effect on models which use {{cmd|$collisionmodel}} instead of {{cmd|$collisionjoints}}. {{tip|In games where this keyvalue is not available, {{ent|prop_dynamic_override}} with collision set to 'Not solid' can be used.}}}}
{{KV|Hold Animation|intn=HoldAnimation|boolean|since={{AS}}|If set, the prop will not loop its animation, but hold the last frame.}}
{{KV|Animate Every Frame|intn=AnimateEveryFrame|boolean|since={{P2}}|Force this prop to animate every frame. Usually this doesn't need to be touched.}}
{{KV|Ignore NPC Collisions|intn=IgnoreNPCCollisions|choices|Disable collisions for [[NPC|NPCs]] if yes.
:*0: No
:*1: Yes
|only={{bms}}}}
{{KV BaseFadeProp}}
{{KV Rendermode}}
{{KV Render FX}}
{{KV|Render Amount / Transparency (0–255)|intn=renderamt|int 0-255|Transparency amount; requires a Render Mode other than '''Normal'''. 0 is invisible, 255 is fully visible.}}
{{KV|Render Color (R G B)|intn=rendercolor|color255|Color tint.}}
{{KV Glow}}
{{KV BreakableProp}}
{{KV CBaseAnimating|noscroll=1|no sequence=1}}
{{KV GMOD}}


==Flags==
{{minititle|DynamicProp}}
{{Fl|64|Use Hitboxes for Renderbox|{{elaborate}}}}
{{Fl|128|Disable [[VPhysics]] collision|nofgd=1}}
{{Fl|256|Start with collision disabled}}
{{Fl BreakableProp}}


* See also [[Prop Types Overview]]
==Inputs==
* 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.
{{I|SetAnimation|param=string|Forces the prop to play the named animation immediately.}}
 
{{I|SetDefaultAnimation|param=string|Changes the animation played when not in a random/forced sequence. New default animations begin when the previous playing animation has ended.}}
== Keyvalues ==
{{I|SetPlaybackRate|param=float|Sets the framerate at which animations are played.}}
*{{kv prop dynamic base}}
{{I|TurnOff|Hides the prop through {{ent|EF_NODRAW}}. The <code>Disable</code> input does the exact same thing.}}
*{{kv parentname}}
{{I|TurnOn|Shows the prop (by removing {{ent|EF_NODRAW}}). The <code>Enable</code> input does the exact same thing.}}
*{{kv global}}
{{I|DisableCollision|Tells the prop to no longer be solid.}}
*{{kv enabledisable}}
{{I|EnableCollision|Tells the prop to become solid again.}}
*'''solid'''
{{I|SetAnimationNoReset|param=string|since=AS|Force the prop to play an animation unless the prop is already playing the animation. The parameter should be the name of the animation.}}
:<choices> Collisions.
{{I|FadeAndKill|since={{P2}}|Fade out then remove this prop.}}
:{|
{{I Glow}}
! Literal value || Description
{{I BreakableProp}}
|-
| 0 || Not Solid
|-
| 2 || Use Bounding Box
|-
| 6 || Use VPhysics
|}


== Flags ==
==Outputs==
*{{fl BreakableProp}}
{{O|OnAnimationBegun|activator = none|Fired when an animation begins.}}
*64 : Use Hitboxes for Renderbox
{{O|OnAnimationDone|activator = none|Fired when an animation finishes.}}
{{O Breakable|prop=1}}


== Inputs ==
==See also==
*{{i parentname}}
* [[Prop Types Overview]]
*{{i studiomodel}}
* {{ent|prop_dynamic_ornament}}
*{{i enabledisable}}
* {{ent|prop_dynamic_override}}
*'''SetAnimation <string>'''
* {{ent|prop_physics}}
: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 [[Body Groups|bodygroup]], by index.
*'''TurnOn'''
:Make the prop visible.
*'''TurnOff'''
:Make the prop invisible.


== Outputs ==
[[Category:Prop entities|dynamic]]
*{{o studiomodel}}
*'''OnAnimationBegun'''
:Fired whenever a new animation has begun playing.
*'''OnAnimationDone'''
:Fired whenever an animation is complete.
*'''OnOutOfWorld'''
:Fired whenever the entity leaves map boundaries.

Latest revision as of 15:33, 22 October 2025

English (en)中文 (zh)Translate (Translate)
C++ Class hierarchy
CDynamicProp
CBreakableProp
CBaseProp
CBaseAnimating
CBaseEntity
C++ props.cpp

prop_dynamic is a model entity available in all Source Source games. It is used to add a model to the world that can animate itself.

Tip.pngTip:If your model is never going to move and/or requires more detailed lighting, consider using prop_static (which is cheaper).
Note.pngNote:To enforce consistency, models with embedded physics data cannot by default be used by prop_dynamic. Use the Hammer model browser's Info tab to check for support. If you intend to use a physics model in non-physics role, use prop_dynamic_override.
Icon-Bug.pngBug:Scaling a prop_dynamic disables its physics collisions.  (tested in: Garry's Mod)
AltNames.pngAltNames: This entity is also tied to dynamic_prop. The classname is always changed to prop_dynamic on spawn.

Uses

  • Buttons can be created by parenting a prop_dynamic to a func_button brush. This will cause +use inputs on the prop to be forwarded to the func_button, which can be placed anywhere in the map (or even outside the map, as long as the origin, if present, is inside). The SetAnimation input can then be used to make the prop animate when interacted with.
  • Similarly, levers can be created by parenting a prop_dynamic to a func_rot_button (or momentary_rot_button) brush. No animation is needed for this - the brush will rotate the prop by itself. As before, the entity can be placed anywhere, as long as the origin is positioned at the point you want it to rotate around.
  • A prop_dynamic can be configured to break apart after receiving damage or on cue by using the Break input.
    Note.pngNote:Health set inside the model will intentionally override health set in Hammer! Use prop_dynamic_override instead if this is an issue.

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
Default Animation (DefaultAnim) <string>
The animation this prop will play when not doing a random or forced animation.
Randomly Animate (RandomAnimation) <boolean>
Makes the prop randomly select and play animations at intervals defined by the Min/Max Random Anim Time KVs. In between the random animations, it will revert to playing Default Animation.
Note.pngNote:Will only select from animation $sequences linked with ACT_IDLE if they exist.
Min Random Anim Time (MinAnimTime) <float>
Minimum time between random animations.
Max Random Anim Time (MaxAnimTime) <float>
Maximum time between random animations.
Collisions (solid) <integer choices>
How the prop should interact with other objects.
  • 0 - Not solid
  • 2 - Use bounding box
  • 6 - Use VPhysics (default)
Update children (updatechildren) <boolean> (in all games since Left 4 Dead)
Update touches for any children that are attached to attachment points as this prop animates. This allows SetParentAttached triggers or func_brushes to touch properly.
Disable Bone Followers (DisableBoneFollowers) <boolean> (in all games since Source 2009)
Disables generation of phys_bone_followers for each convex piece the model has in its collision model. phys_bone_followers can quickly eat up the edict count, so this keyvalue can be very helpful in freeing resources. This will however make the collision model no longer function (the model will be nonsolid to anything that uses the collision model instead of the hitbox[Elaborate?]). No effect on models which use $collisionmodel instead of $collisionjoints.
Tip.pngTip:In games where this keyvalue is not available, prop_dynamic_override with collision set to 'Not solid' can be used.
Hold Animation (HoldAnimation) <boolean> (in all games since Alien Swarm)
If set, the prop will not loop its animation, but hold the last frame.
Animate Every Frame (AnimateEveryFrame) <boolean> (in all games since Portal 2)
Force this prop to animate every frame. Usually this doesn't need to be touched.
Ignore NPC Collisions (IgnoreNPCCollisions) <choices> (only in Black Mesa)
Disable collisions for NPCs if yes.
  • 0: No
  • 1: Yes

BaseFadeProp:

Start Fade Dist (fademindist) <float>
Distance at which the entity starts to fade.
End Fade Dist (fademaxdist) <float>
Max fade distance at which the entity is visible.
  • If start fade is <0, the entity will disappear instantly when end fade is hit.
  • If end fade is <0, the entity won't disappear at all. (This is the default behavior.)
The values will scale appropriately if the entity is in a 3D Skybox.
Fade Scale (fadescale) <float>
If you specify so in worldspawn, or if the engine is running below DirectX 8 (DX7 in Source 2006), props will fade out even if the fade distances above aren't specified. This value gives you some control over when this happens: numbers smaller than 1 cause the prop to fade out at further distances, while those greater than 1 cause it to fade out at closer distances. Using 0 turns off the forced fade altogether. See also the QC command $noforcedfade.


Render Mode (rendermode) <byte choices>
Set a non-standard rendering mode on this entity.
Render Modes
  • 0: Normal
  • 1: Color
  • 2: Texture
  • 3: Glow
  • 4: Solid/Alphatest Obsolete
  • 5: Additive
  • 6: Removed, does nothing Obsolete
  • 7: Additive Fractional Frame
  • 8: Alpha Add
  • 9: World Space Glow
  • 10: Don't Render
Render FX (renderfx) <byte choices>
Various somewhat legacy alpha effects. See render effects.
Render Amount / Transparency (0–255) (renderamt) <integer 0–255>
Transparency amount; requires a Render Mode other than Normal. 0 is invisible, 255 is fully visible.
Render Color (R G B) (rendercolor) <color255>
Color tint.

Glow:

Glow State (glowstate) <choices> (only in Left 4 Dead 2)
  • OFF
  • +use
  • look-at
  • ON
Glow Range (glowrange) <integer> (only in Left 4 Dead 2)
Range at which the glow becomes visible on approach. 0 means always visible.
Glow Range Min (glowrangemin) <integer> (only in Left 4 Dead 2)
Inner range at which the glow stops being visible on approach. 0 means always visible.
Glow Color Override (R G B) (glowcolor) <color255> (only in Left 4 Dead 2)
Change the render color of the glow.

BreakableProp:

Explosion Damage (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.
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.
Sound to make when punted (puntsound) <sound> (in all games since Half-Life 2: Episode One)
Sound to make when punted by gravity gun.
Break Model Message (BreakModelMessage) <string> (only in Source 2013)
"If set, will use this break model message instead of the normal break behavior."

Breakable (common):

Performance Mode (PerformanceMode) <choices>
Used to limit the amount of gibs produced when this entity breaks, for performance reasons.
Choices
  • 0: Normal
  • 1: No Gibs
  • 2: Full Gibs on All Platforms (Xbox 360, PS3, etc)
  • 3: Reduced gibs
Min Damage to Hurt (minhealthdmg) <integer>
If a single hit to the object doesn't do at least this much damage, the prop won't take any of the damage it attempted to give.
Pressure Delay (PressureDelay) <float>
Seconds to delay breaking from pressure. Allows creaking/groaning sounds to play.
Health (health) <integer>
How close to breaking the object is.
Maximum Health (max_health) <integer>
Health cannot exceed this amount.
Physics Impact Damage Scale (physdamagescale) <float>
Multiplier for damage amount when this entity is hit by a physics object. With a value of 0 the entity will take no damage from physics.
Breakable By (BreakableType) <choices> (only in Left 4 Dead seriesLeft 4 Dead series)
Who can break this?
  • 0: Everyone
  • 1: All Infected
  • 2: Only Tanks
Non-Valve games Black Mesa
Enable Explosion Override (explosion_override) <choices> (only in Black Mesa) !FGD
Enable/disable explosion parameters override (explosion_particle, explosion_particle_liquid, explosion_attachment, explosion_soundscript and explosion_soundscript_liquid).
  • 0: No
  • 1: Yes
Explosion Particle (explosion_particle) <string> (only in Black Mesa) !FGD
A particle system to use when this entity explodes.
Explosion Particle Underwater (explosion_particle_liquid) <string> (only in Black Mesa) !FGD
A particle system to use when this entity explodes in water.
Explosion Attachment Point (explosion_attachment) <string> (only in Black Mesa) !FGD
An attachment point to use for custom explosion particle system.
Note.pngNote:Only for model entities, even despite the fact that this is also present in brush entities.
Explosion Sound Script (explosion_soundscript) <sound> (only in Black Mesa) !FGD
A sound script to use when this entity explodes.
Explosion Sound Script Underwater (explosion_soundscript_liquid) <sound> (only in Black Mesa) !FGD
A sound script to use when this entity explodes in water.
Icon-Important.pngImportant:Both explosion_soundscript and explosion_soundscript_liquid require a sound script, a raw sound file will not work.

CBaseAnimating:

World Model (model) <model path>
The model this entity should appear as. 128-character limit.
Skin (skin) <integer>
Some models have multiple skins. This value selects from the index, starting with 0. May be overridden by game code.
Tip.pngTip:Hammer's model browser automatically updates this value if you use it to view different skins.
Model Scale (modelscale) <float> (in all games since Alien Swarm) (also in Source 2013)
A multiplier for the size of the model.
Tip.pngTip:In Hammer++ Hammer++ with a prop selected in 3D view, hold Ctrl and scroll the mouse wheel to change the modelscale in increments of 0.5. Holding Shift will scale it in smaller increments of 0.05.
Bodygroup (body / SetBodyGroup) <integer>
Some models have multiple submodels. This value selects from the index, starting with 0. May be overridden by animations and/or game code.
Note.pngNote:If both body and SetBodyGroup are present (even if set to 0), body will be prioritized.


Lighting Origin (lightingorigin) <targetname>
Select an entity (not info_lighting!) from which to sample lighting and cubemaps instead of the entity's $illumposition.

Shadow:

Disable Shadows (disableshadows) <boolean>
Prevents the entity from creating cheap render-to-texture shadows, or lightmap shadows if the entity is a prop_static. Does not affect shadow mapping.
Disable Receiving Shadows (disablereceiveshadows) <boolean>
Prevent the entity from receiving dynamic shadows on itself.
Shadow Cast Distance (shadowcastdist) <integer> !FGD
Sets how far the entity casts dynamic shadows. 0 means default distance from the shadow_control entity.
Disable Shadow Depth (disableshadowdepth) <boolean> (in all games since Portal 2)
Used to disable rendering into shadow depth (for projected textures) for this entity.
Disable flashlight (disableflashlight) <boolean> (in all games since Portal 2)
Used to disable projected texture lighting and shadows on this entity.
Projected Texture Cache (shadowdepthnocache) <integer choices> (in all games since Portal 2)
Used to hint projected texture system whether it is sufficient to cache shadow volume of this entity or to force render it every frame instead.
Choices
  • 0 : Default
  • 1 : No cache - render every frame
  • 2 : Cache it - render only once
Render in Fast Reflections (drawinfastreflection) <boolean> (in all games since Portal 2)
If enabled, this entity will render in fast water reflections (i.e. when a water material specifies $reflectonlymarkedentities) and in the world impostor pass.

GMODSandbox:

Allow Physics Gun (gmod_allowphysgun) <boolean> (only in Garry's Mod)
If set, players cannot use Physics Gun on this entity.
Sandbox Tool Whitelist (gmod_allowtools) <string> (only in Garry's Mod)
If set, only given tools can be used on this entity. You need to supply the tool class names, the names of the .lua files of those tools. This also includes the context menu properties!

Flags

DynamicProp:

Use Hitboxes for Renderbox : [64]
[Elaborate?]
Disable VPhysics collision : [128] !FGD
Start with collision disabled : [256]

BreakableProp:

Break on Touch : [16]
Break on Pressure : [32]
Will break after being stood on for PressureDelay seconds.
Note.pngNote:Some models will break instantly if this is or isn't set. (e.g. militiawindow02_breakable.mdl, window_industrial.mdl)

Inputs

SetAnimation <stringRedirectInput/string>
Forces the prop to play the named animation immediately.
SetDefaultAnimation <stringRedirectInput/string>
Changes the animation played when not in a random/forced sequence. New default animations begin when the previous playing animation has ended.
SetPlaybackRate <floatRedirectInput/float>
Sets the framerate at which animations are played.
TurnOff
Hides the prop through EF_NODRAW. The Disable input does the exact same thing.
TurnOn
Shows the prop (by removing EF_NODRAW). The Enable input does the exact same thing.
DisableCollision
Tells the prop to no longer be solid.
EnableCollision
Tells the prop to become solid again.
SetAnimationNoReset <stringRedirectInput/string> (in all games since Alien Swarm)
Force the prop to play an animation unless the prop is already playing the animation. The parameter should be the name of the animation.
FadeAndKill  (in all games since Portal 2)
Fade out then remove this prop.

Glow:

StartGlowing  (only in Left 4 Dead 2)
Turn on glow effect for this prop.
StopGlowing  (only in Left 4 Dead 2)
Turn off this prop's glow effect.

BreakableProp:

Break
Breaks the breakable.
SetHealth <integerRedirectInput/integer>
Sets a new value for the breakable's health. If the breakable's health reaches zero it will break.
AddHealth <integerRedirectInput/integer>
Adds health to the breakable.
RemoveHealth <integerRedirectInput/integer>
Removes health from the breakable.
physdamagescale <floatRedirectInput/float>
Sets Physics Impact Damage Scale. 0 means this feature is disabled for backwards compatibility.
EnablePhyscannonPickup
Makes the breakable able to picked up by the gravity gun.
DisablePhyscannonPickup
Makes the breakable not able to picked up by the gravity gun.
EnablePuntSound  (in all games since Half-Life 2: Episode One)
Allow this prop from playing its Punt Sound sound when punted by the gravity gun.
DisablePuntSound  (in all games since Half-Life 2: Episode One)
Prevent this prop from playing its Punt Sound sound when punted by the gravity gun.

Outputs

OnAnimationBegun
!activator = none
!caller = this entity
Fired when an animation begins.
OnAnimationDone
!activator = none
!caller = this entity
Fired when an animation finishes.

BreakableProp:

OnBreak
!activator = entity that breaks the object
!caller = this entity
Fired when this object breaks.
OnHealthChanged <floatRedirectOutput/float>
!activator = entity that caused the health change
!caller = this entity
Fired whenever the health of the breakable has increased or decreased. This output automatically puts the new health amount as a decimal percent (e.g. 45% = 0.45) into the parameter box for inputs, if the mapper does not override the parameter with something else.
OnTakeDamage
!activator = entity that caused the damage
!caller = this entity
Fired when damage is taken.
OnPhysCannonAnimatePreStarted
!activator = none
!caller = this entity
Fired when prop starts its ACT_PHYSCANNON_ANIMATE_PRE activity. Caused by the object being picked up by the gravity gun.
OnPhysCannonAnimatePullStarted
!activator = none
!caller = this entity
Fired when prop has started its ACT_PHYSCANNON_ANIMATE activity. ACT_PHYSCANNON_ANIMATE_PRE plays once, then ACT_PHYSCANNON_ANIMATE starts looping.
OnPhysCannonDetach
!activator = none
!caller = this entity
Fired when prop has started its ACT_PHYSCANNON_DETACH activity (caused by the gravity gun ripping it from a wall).
OnPhysCannonAnimatePostStarted
!activator = none
!caller = this entity
Fired when prop has started its ACT_PHYSCANNON_ANIMATE_POST activity (caused by the player letting the prop go from the gravity gun).
OnPhysCannonPullAnimFinished
!activator = none
!caller = this entity
Fired when prop has finished all gravity gun-related animations.

See also