Hey guys. I'm trying to detect if there's some entity or wall between my entity (ent) and a player (id), and I'm having issues with trace_line native
PHP Code:
new Float:vstart[3], Float:vend[3], Float:vret[3]
entity_get_vector(ent, EV_VEC_origin, vstart)
entity_get_vector(id, EV_VEC_origin, vend)
new hit = trace_line(ent, vstart, vend, vret)
new hitr = traceresult(TR_Hit)
new Float:fraction
traceresult(TR_Fraction, fraction)
client_print(id, print_chat, "trace_line -> hit = %d hitr = %d fraction = %.1f", hit, hitr, fraction)
It always returns the same values, no matter if there is or isn't anything between ent and id
Code:
trace_line -> hit = 0 hitr = -1 fraction = 0.0
I've tried the inverse trace, from the player (id) to the entity (ent) but keep getting the same results. What am I doing wrong?
__________________