Page 1 of 1

[CSGO] player.view_coordinates issue

Posted: Thu Apr 14, 2016 2:57 pm
by VinciT
For some reason, .view_coordinates doesn't fully follow the crosshair when it comes to looking all the way up or down, as you can see in this image:

Image

Syntax: Select all

#view_coords_test.py
from events import Event

from players.entity import Player
from players.helpers import index_from_userid

from effects import temp_entities
from filters.recipients import RecipientFilter
from engines.precache import Model


laser = Model('sprites/laserbeam.vmt')

@Event('weapon_fire')
def pewpew(game_event):
player = Player(index_from_userid(game_event.get_int('userid')))

start = player.eye_location
end = player.view_coordinates

temp_entities.beam_points(RecipientFilter(), 0, start, end, laser.index, laser.index, 0, 255, 5, 1, 1, 2, 0, 255, 255, 0, 75, 1)

I'm guessing this has something to do with the view_vector?

Posted: Fri Apr 15, 2016 1:34 pm
by Ayuto

Posted: Fri Apr 15, 2016 5:10 pm
by VinciT
Awesome, thanks Ayuto!