The regular trace will exclude a player as a target if the trace doesn't collide with the bounding box.
It is possible to do an additional check on eligible players and force a trace against their hitboxes with enginetrace->ClipRayToEntity. That's per target player, so you can do extra work to make the list of potential players you're tracing against as small as possible. In pseudocode: For all players { if this player is likely to be hit by the ray ( this check can do a DistanceToRay from the traceline and exclude if needed ) { do the enginetrace->ClipRayToEntity now check if we hit the player and the hit was the closest thing that we hit } } -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of JG Sent: Monday, June 12, 2006 4:40 PM To: hlcoders@list.valvesoftware.com Subject: Re: [hlcoders] TraceRay not hitting player's head I realize this is an old topic, but I have this same problem and can't find a solution. http://www.sourcemod.net/forums/viewtopic.php?t=3658 As you can see, the "bounding box" doesn't actually surround the whole model, so there lies the problem.. There's got to be a way to fix this since the traces done when someone fires at someone's head don't just go through the player's head. I just have no clue how to accomplish this. Any help would be greatly appreciated. -- [ Picked text/plain from multipart/alternative ] Good call. Yes, it's for CS:S. On 3/25/06, Aaron Schiff <[EMAIL PROTECTED]> wrote: > > -- > [ Picked text/plain from multipart/alternative ] Are you using CS:S? > coz CS:S models are weird... > > On 3/24/06, LDuke <[EMAIL PROTECTED]> wrote: > > > > -- > > [ Picked text/plain from multipart/alternative ] For debugging > > purposes, in a MP game, I'm drawing a line to the endpoint of the > > trace. If I aim at a foot, body, hand, etc. the player entity is > > returned and the line gets drawn to that point. But if I aim at the > head, > > the trace doesn't see the player and it draws the line right through > > the player's head to whatever is behind him. > > > > CTraceFilterHitAll traceFilter; > > enginetrace->TraceRay(ray, MASK_ALL, &traceFilter, &tr ); > > > > Do I need to change my mask or trace filter I need to use to include > > the > a > > player's head? Why won't this work? > > > > Grant > > (L. Duke) > > -- > > > > _______________________________________________ > > To unsubscribe, edit your list preferences, or view the list > > archives, please visit: > > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > > > > > > -- > ts2do > -- > > _______________________________________________ > To unsubscribe, edit your list preferences, or view the list archives, > please visit: > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > -- _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders