Raised This Month: $ Target: $400
 0% 

Get entity user is aiming at (Not Solid one)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-13-2011 , 16:41   Re: Get entity user is aiming at (Not Solid one)
Reply With Quote #2

Do the trace from player's eyes to first get the player's aim origin as well as checking if it hit an entity.
Keep that first hit entity in a unique variable saved for later.
Then at small intervals, do a find_ent_in_sphere() check with small radius, following the trace line path.
If you find something in that sphere that is not solid, return that entity.
If you don't find anything, return the entity you found in the beginning.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:22.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode