PlayerPhysicsComponent
public class PlayerPhysicsComponent : PhysicsComponent
{
//phys component to help override some movement to be more twitchy for players
public PlayerNetworkEntity playerNetworkEntity;
//...
This PhysicsComponent extends the orignal to make for twitchier movement more akin to what players expect. When moving our characters around, we don’t always want to apply acceleration to change direction on a character or keep moving until our velocity has slowed down, so this class was built to have snappy directional changes and stops. This class is fairly customised to the demo project, so feel free to either tamper with it or use it as a guide to build your own.
Methods
public override void ApplyForces()
Overridden from the PhysicsComponent to either use the players movement or the parent classes
public override void MoveWithCollisionData(sfloat shortestCollisionTime, sfloat normalx, sfloat normaly)
Calls the original from PhysicsComponent and then the rest is up to you. Currently set to slide along surfaces by tweaking the current velocity