Question on how to add a double jump and eventually a wall dodge

you can just have a global boolean

CanDoSecondJump

that is false until the user jumps the first time

then on first jump you set it to true

then if they do second jump, you set it false

and if they land, you set it to false

check out Character.h for the onlanded event to set the bool to false again




/** Called on landing after falling has completed, to perform actions based on the Hit result. Triggers the OnLanded event. */
	virtual void Landed(const FHitResult& Hit);



then whenever player presses the jump button you can check the boolean and apply force


if(CanDoSecondJump)
{
  //apply force
}

Here’s how I apply force, it replicates automatically in a networked context, as long as you call it server-side


MyCharacter->CharacterMovement->Velocity += FVector(0,0,1) * 30000;

just change the 30000 to change jump amount

could make the jump directional using




GetRootComponent()->GetRightVector() and GetForwardVector()