View Single Post
Author Message
RayZek95
Junior Member
Join Date: Sep 2013
Old 01-10-2023 , 20:42   Set origin entity to ground
Reply With Quote #1

Hi everyone, there's a way to set the origin of an entity to ground?

I tried this way of metalicross:
PHP Code:
stock GetUserEyePosition(iIdFloat:vecReturn[3], Float:fNormalDist// mia gordo mia :3
{
    static 
Float:vecStart[3], Float:vecEnd[3]
    
entity_get_vector(iIdEV_VEC_originvecStart)
    
entity_get_vector(iIdEV_VEC_view_ofsvecEnd)
    
    
xs_vec_add(vecStartvecEndvecEnd// vista de los ojos
    
    
entity_get_vector(iIdEV_VEC_v_anglevecEnd)
    
engfunc(EngFunc_MakeVectorsvecEnd)
    
get_global_vector(GL_v_forwardvecEnd)
    
xs_vec_mul_scalar(vecEnd9999.9vecEnd)
    
    
xs_vec_add(vecStartvecEndvecEnd// vista a la mierda de los ojos
    
    
engfunc(EngFunc_TraceLinevecStartvecEndDONT_IGNORE_MONSTERSiId0)
    
    
get_tr2(0TR_vecPlaneNormalvecEnd)
    
xs_vec_mul_scalar(vecEndfNormalDistvecEnd// distancia de la normal de la superficie
    
    
get_tr2(0TR_vecEndPosvecReturn)
    
xs_vec_add(vecReturnvecEndvecReturn)

Works, but I want to restrict that for only aiming the ground; and in the case that is aiming the ground always set the origin in Z coordenate = 0 (in other words, "set to ground")
__________________
RayZek95 is offline