RPG Platformer Controls

I wanted to create a platformer type RPG, learning while doing this course. Having a Master of Science degree in Medialogy - Games specialization helps quite a bit, but I’ve never done a “BIG” development, as in full game development.

For the feel of the game, I want a 3rd person cam that sits behind the player or to the side, but relatively close. For the controls I primarily want a controller but WSAD should work as well. The player should also be able to move while jumping.
This is the modified code

PlayerMovement script:

Private Void Update{
if (isInDirectMode)
    {
        if (!m_Jump)
        {
            m_Jump = Input.GetButtonDown("Jump");
            
        }
    }
}

In the ThirdPersonCharacter script

void HandleAirborneMovement(Vector3 move)
	{
        jumpBegun = true;
		// apply extra gravity from multiplier:
		Vector3 extraGravityForce = (Physics.gravity * m_GravityMultiplier) - Physics.gravity;
        if (usePlatformControls)
        {
            m_Rigidbody.AddForce(extraGravityForce);
            m_Rigidbody.AddRelativeForce(move);
            //print(timer);
            if(preJumpYPos+airMoveOffset <= transform.position.y)
            {
                print("Adding Relative Force");
                m_Rigidbody.AddRelativeForce(0, 0, move.z*platformControlMultiplier);
            }


        }
        else
        {
            m_Rigidbody.AddForce(extraGravityForce);
        }
		

		m_GroundCheckDistance = m_Rigidbody.velocity.y < 0 ? m_OrigGroundCheckDistance : 0.01f;
	}

Come to think of it, the force might have been added more easily within the playerMovement script.

Let me know what you think of this type of movement, and any improvements on implementation :smiley:

Privacy & Terms