I'm attempting to stick a glowing light (
env_lightglow) on a player's head when they use night / motion / thermal vision.
What I am doing in
my messy code is basically:
- spawn either an info_target or a NODRAW prop_dynamic
- parent it to the player's head
- spawn an env_ligthglow
- set the above spawned entity as the parent to the env_lightglow
The env_lightglow is properly attached.
However, the transparency of the env_lightglow doesn't update properly according to the player position!
Rather, it only updates according to the initial coordinates for the env_lightglow (at the time it is parented to the entity attached to the player's head), instead of the player's (updating) absorigin. ;(
It's like parenting doesn't continuously update its actual internal origin (even if I parent it directly to the player instead of an info_target).
Are these entities supposed to be immobile only?
Source code for the client-side entity:
here, for the server-side:
here
If I read correctly,
this is what should be responsible for the updating of the glow sprite? I don't know much C++...
Does anyone have had experience dealing with these entities? I can't tell why the subsequent entities spawned are not rendered properly on the client side according to their parented entity.
I use a regular env_sprite as a fallback, but those don't have a "Visible only from front" flag, so they show through cloaked players.