Vertical input for wall walking while extending Pseudo3D

@ChristianWiele

In the context of the Pseudo3D MovementType, which methods do I need to override to ensure that vertical input can move the character along their local horizontal axis?

For example:
  1. Horizontal input works as expected for moving the character left and right (while RestrictPosition locks movement on z-axis)
  2. I input left toward a wall
  3. I have a custom mount that rotates and moves the character up to the wall
  4. It is now properly grounded like step 1 (but now on a wall) and left/right input moves the character up and down the wall respectively (due to left/right input moving the character along their local horizontal axis)
  5. How do I get the results of step 4 (move up and down the wall) while the input is up and down?
    • This is a simple mapping exercise generally, but I don't yet know where I need to do this mapping in the context of UCC. Is there a built-in way that I'm overlooking? If not, what do I need to override to get that behavior?
 
Last edited:
FWIW the solution was simple as expected. The location of where to do this AFAICT is in a custom MovementType's GetInputVector. This is the class (I don't need or use forward direction):

Code:
public class 2D : Pseudo3D
{
    public override float GetDeltaYawRotation(float characterHorizontalMovement, float characterForwardMovement, float cameraHorizontalMovement, float cameraVerticalMovement)
    {
        return 0;
    }
    
    public override Vector2 GetInputVector(Vector2 inputVector)
    {
        float angle = Vector3.Angle(m_CharacterLocomotion.Up, Vector3.up);
        angle *= m_CharacterLocomotion.Up.x < 0 ? -1 : 1;
        return Quaternion.Euler(0, 0, angle) * inputVector;
    }
}
 
Top