Moonwalking Slowness (Slower to run backwards in Target Based Looking)
Firstly, thanks Gyvr for adding Movement Based and Target Based - Look Direction. For those not aware, movement based will have it so your player looks in the movement direction, even if you are aimed behind you, you will turn around to shoot, then continue moving in the other direction - target based will have the player always facing the direction of the mouse, this can give the effect of running backward while attacking. I prefer the ‘moonwalk’ or backward walking, but I wanted to make it feel more punishing, because running backwards and attacking is harder than running forward… so this quick change to Movable.cs will add a slider that lets you change the speed if the look and move directions don’t line up 😉
TLDR: Target Based Look Direction for player = slower move speed when running backwards, this has no effect on Movement Based (and default is 100%, so it does nothing unitl you lower it)
Open Movable.cs
Add to Movement Settings:
SerializeField, Range(0.1f, 1.0f)] private float m_backwardsSpeedMultiplier = 1.0f;
Change HandleMovment() else section:
else
{
float baseSpeed = CalculateMoveSpeed();
float runSpeed = baseSpeed;
float alignment = Vector2.Dot(m_movementDirection.normalized, m_lookAtDirection.normalized);
if (alignment < 0f)
{
runSpeed = baseSpeed * m_backwardsSpeedMultiplier;
}
MoveInDirection(m_movementDirection, runSpeed);
}

💬 Comments (0)
Be the first to comment! Join our Discord to share your thoughts.
Want to continue the conversation?