Raised This Month: $51 Target: $400
 12% 

[TF2/L4D*/?] [SNIPPET] Smoothly turning players


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Phil25
AlliedModders Donor
Join Date: Feb 2015
Old 10-06-2018 , 14:20   [TF2/L4D*/?] [SNIPPET] Smoothly turning players
Reply With Quote #1

I've found that view punch works really well with rotating the player because of its instant effect and smoothing towards the actual player view.

Applying it in the other direction, on the same frame, produces smooth turning effect with a little bit of wobbling at the end if the angle is wide enough. This only works in first person, other players just see the client spazzing about.

PHP Code:
stock void RotateClientSmooth(int clientfloat fAngle){
    
float fPunch[3], fEyeAng[3];
    
GetClientEyeAngles(clientfEyeAng);

    
fEyeAng[1] -= fAngle;
    
fPunch[1] += fAngle;

    
TeleportEntity(clientNULL_VECTORfEyeAngNULL_VECTOR);
    
SetEntPropVector(clientProp_Send"m_vecPunchAngle"fPunch);

PHP Code:
RotateClientSmooth(client30.0); // turns client 30 degrees to right 
I don't know if m_vecPunchAngle is available for mods other than TF2.

Last edited by Phil25; 10-07-2018 at 00:58.
Phil25 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:48.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode