Cast ray: Difference between revisions
Jump to navigation
Jump to search

Warning:Make sure your game is not paused when issuing these commands or the overlay for it won't show up. (type unpause in console before writing the command or bind it to a button
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{LanguageBar|title = {{mono|cast_ray / cast_hull}}}} | {{LanguageBar|title = {{mono|cast_ray / cast_hull}}}} | ||
{{TabsBar}} | {{TabsBar}} | ||
[[File:Cast ray-example.jpg|thumb|right|Example in {{portal}}. (see [[:File:Cast ray-example.jpg|file summary]]) ]] | |||
{{This is a|console command|name=cast_ray|name1=cast_hull|notitlechange=1}} Casts a ray or hull and shows what it hit in console. | {{This is a|console command|name=cast_ray|name1=cast_hull|notitlechange=1}} Casts a ray or hull and shows what it hit in console. | ||
Revision as of 05:51, 12 May 2025


cast_ray
and cast_hull
are console commands available in all Source games. Casts a ray or hull and shows what it hit in console.

bind e cast_ray
)Information it gives
DevMsg(1, "Hit %s\nposition %.2f, %.2f, %.2f\nangles %.2f, %.2f, %.2f\n", tr.m_pEnt->GetClassname(),
tr.m_pEnt->GetAbsOrigin().x, tr.m_pEnt->GetAbsOrigin().y, tr.m_pEnt->GetAbsOrigin().z,
tr.m_pEnt->GetAbsAngles().x, tr.m_pEnt->GetAbsAngles().y, tr.m_pEnt->GetAbsAngles().z );
DevMsg(1, "Hit: hitbox %d, hitgroup %d, physics bone %d, solid %d, surface %s, surfaceprop %s, contents %08x\n", tr.hitbox, tr.hitgroup, tr.physicsbone, tr.m_pEnt->GetSolid(), tr.surface.name, physprops->GetPropName( tr.surface.surfaceProps ), tr.contents );
Examples
] cast_ray Hit func_breakable position -456.00, -346.00, -132.00 angles 0.00, 0.00, 0.00 Hit: hitbox 0, hitgroup 0, physics bone 0, solid 1, surface maps/c1a0/halflife/glass_med_-521_-303_-144, surfaceprop glass, contents 00000001
] cast_hull Hit monster_gman position -360.00, -316.00, -215.00 angles 0.00, 93.00, 0.00 Hit: hitbox 0, hitgroup 0, physics bone 0, solid 2, surface **studio**, surfaceprop default