Players angle same as entities angle

Hello,

I’ve been trying recently to set the players angle the same as the entities angles, but it doesn’t seem to be working, this is what I have tried:


local ent1 = "bed"

 for k, v in pairs( ents.FindByClass( ent1 ) ) do
 	pos = v:GetPos()
        ang = v:GetAngles()
 	ply:SetPos( pos )
 	ply:SetEyeAngles( ang )
 end

But this doesn’t seem to work, position works fine though.

:snip: misread

SetEyeAngles affect only on direction where you look (Shooting, opening doors, etc.), but actually don’t change model angle. I think you’re looking for ply: SetRenderAngles (Angle on) or CUserCmd: SetViewAngles (Angle viewAngle). SetViewAngles have a lot of caveats because affect on the direction of your movement.