SetAngles() instead of PointAtEntity()

It’s 1:35 am and my brain is on fire.

What was the formel again to make the same happen as EntityPointAt() with SetAngles()?

Want that an entity is pointing at the following (below) with SetAngles() or SetKeyValue( ‘angles’, Angle ):


tar:LocalToWorld(tar:OBBCenter())

[editline]22nd October 2011[/editline]

bump

[editline]23rd October 2011[/editline]

bump

bump

What? just use SetAngle()

What?
Question is: How to use SetAngles to look exactly this way:


tar:LocalToWorld(tar:OBBCenter())

(The Center of another Entity. btw)

[editline]23rd October 2011[/editline]

No one?

It’s either

[lua]Pointer:SetAngles((Pointer:GetPos() - TargetPos):Angle())[/lua]

or

[lua]Point:SetAngles(TargetPos - Pointer:GetPos()):Angle())[/lua]

Can never remember which.

I forgot the :Angle() at the end. The second works obviously, that’s what I first tried.

Thanks.

The second one can’t work because you’re missing one left parenthesis. :v:
I guess you meant this:

[lua]Point:SetAngles((TargetPos - Pointer:GetPos()):Angle())[/lua]

Yes that’s correct. I noticed that he missed one, too. But I thought: no need to reply.

The point in his lua code was correct, though.