← Back to all addons

Dash - Stuck on walls collision detection

Posted by Soho on Jan 22, 2026 at 11:09 PM

Bug Fix
❄️ 2

Quick and easy fix for when player uses the Dash Ability and collides with a wall. You might notice they get stuck!

This is because the player remains in a pushed state, continuously attempting to move into the wall on each frame until the push intensity decayed to zero.

Open Movable.cs In ExecutePushOrder() (Line 450) Remove:

if (pushOrder.intensity > 0.2f)
{
    bool movementSuccess = TryMove(pushOrder.direction, pushOrder.intensity);
    pushOrder.intensity = math.lerp(pushOrder.intensity, 0.0f, Time.fixedDeltaTime * pushOrder.resistance);
    m_pushOrder = pushOrder;

    if (!movementSuccess)
    {
        foreach (GameObject go in m_castCollisionSet)
        {
            if (m_pushOrder.Value.AddCollision(go))
            {
                CollisionDispatcher.RegisterCollision(this, go);
            }
        }
    }
}

And replace it with:

if (pushOrder.intensity > 0.2f)
{
    bool movementSuccess = TryMove(pushOrder.direction, pushOrder.intensity);
    
    if (!movementSuccess)
    {
        foreach (GameObject go in m_castCollisionSet)
        {
            if (m_pushOrder.Value.AddCollision(go))
            {
                CollisionDispatcher.RegisterCollision(this, go);
            }
        }
        m_pushOrder = null;
    }
    else
    {
        pushOrder.intensity = math.lerp(pushOrder.intensity, 0.0f, Time.fixedDeltaTime * pushOrder.resistance);
        m_pushOrder = pushOrder;
    }
}

Fixed! The push order is immediately canceled when TryMove() returns false (indicating a collision). This will allow the player to regain full control immediately after hitting a wall.

Dash - Stuck on walls collision detection

💬 Comments (2)

Gyvr Jan 22, 2026 at 11:59 PM
Super useful! Especially when playing with higher dash intensity values 💪
❤️ 1
Soho Jan 23, 2026 at 12:05 AM
Yeah should have prefaced that, I forgot how low the intensity is in base M2D lol
👌 1

Want to continue the conversation?