• Make an entity face an object using angles?
    3 replies, posted
Hey guys, I'm trying to set an entities angles by using: [lua]self:SetAngles(Angle(0,lz,0))[/lua] However, I want my variable LZ to basically tell my entity to face another entity (where lz is the yaw that will make my entity face the other one). I already have the entity I want, I don't need to create for loops to find it. Does anyone know a good method to do this?
I think it is: (vectortoface - currentvector):Angle()
[code]( mypos - targetpos ):GetNormal( ):Angle( ).y + required_offset ) % 360[/code] Depending on your entity, you may need to add an angle to it for it to visually face the correct way.
Thanks! Just figured it out on my own and that's exactly what I did.
Sorry, you need to Log In to post a reply to this thread.