Need a little help with E2 holos.

Hello!
I am trying to turn holo so it will look at me no matter how e2 is positioned. But I can’t find a perfect solution.



@name Holos
@persist [E O]:entity

if(first())
{
    runOnTick(1)

    O = owner()
    
    E = entity()
    
    #Base
    holoCreate(0)
    holoModel(0,"cube")
    holoParent(0,E)
    holoColor(0, vec(0,0,0))
    holoScaleUnits(0,vec(5,5,5))
    
    #BaseAng
    holoCreate(1)
    holoScaleUnits(1,vec(7,7,7))
    holoModel(1, "hq_cube")
    holoPos(1,holoEntity(0):pos())
    holoAng(1, E:toWorld(ang(0,0,0)))
    holoColor(1,vec(0,0,255))
    holoParent(1,0)
}

Head = O:shootPos()

#Doesn't work properly
#holoAng(1,-holoEntity(0):heading(O:shootPos())+ang(-holoEntity(0):angles()[1],holoEntity(0):angles()[2],0))

#Doesn't work properly
#holoAng(1,angnorm(ang(-holoEntity(0):elevation(owner():pos()),-holoEntity(0):bearing(owner():pos()),0)+angnorm(ang(-holoEntity(0):angles()[1],holoEntity(0):angles()[2],0))))

#Doesn't work properly
#holoAng(1,ang(holoEntity(0):angles()[1]-holoEntity(0):elevation(Head),holoEntity(0):angles()[2]-holoEntity(0):bearing(Head),0))


Btw, shootPos() is a position of a head of a player

Any suggestions?

Ang = (Head-holoentity(1):pos()):toAngle()
Angle is equal to Target minus current position to angle

this should work, haven’t messed with e2 holos in a while


 holoAng(1,Head:toAngle()+ang(0,180,0)) 

Thank you VERY MUCH!
This is EXACTLY what I was looking for!