Get entity user is aiming at (Not Solid one)
I want to know if user is looking directly at weaponbox, but
PHP Code:
PHP Code:
so can anything be done? |
Re: Get entity user is aiming at (Not Solid one)
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. |
Re: Get entity user is aiming at (Not Solid one)
Quote:
Quote:
maybe did you mean End origin of a traceline which represents the hit of the wall? Quote:
Quote:
|
Re: Get entity user is aiming at (Not Solid one)
Quote:
Do a trace line, and store the end position as the player's aim origin. Also, check that trace line to see if it hit an entity. (<--- THAT ENTITY, doesn't matter what entity it is, could also hit nothing!) Then you will be doing your sphere checks from the eyes origin to the aim origin. Quote:
|
Re: Get entity user is aiming at (Not Solid one)
Quote:
|
| All times are GMT -4. The time now is 03:22. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.