# 5.3 Default Character Movement Controller Gravity Direction Greyed Out

**URL:** <https://forums.unrealengine.com/t/5-3-default-character-movement-controller-gravity-direction-greyed-out/1356641>\
**Category:** Blueprint\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [November 1, 2023, 9:51pm UTC](https://forums.unrealengine.com/t/5-3-default-character-movement-controller-gravity-direction-greyed-out/1356641 "2023-11-01T21:51:52Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [November 1, 2023, 10:21pm UTC](https://forums.unrealengine.com/t/5-3-default-character-movement-controller-gravity-direction-greyed-out/1356641/2 "2023-11-01T22:21:17Z")

</div>

Make a custom movement component that extends character movement component and add a custom function to override gravity

```auto

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "CharacterMovementComponentEX.generated.h"

/**
 * 
 */
UCLASS()
class MYGAMENAME_API UCharacterMovementComponentEX : public UCharacterMovementComponent
{
	GENERATED_BODY()

	UFUNCTION(BlueprintCallable)
	void SetGravDirection(const FVector& GravityDir);
};

```

```auto
// Fill out your copyright notice in the Description page of Project Settings.

#include "CharacterMovementComponentEX.h"

void UCharacterMovementComponentEX::SetGravDirection(const FVector& GravityDir) {
	Super::SetGravityDirection(GravityDir);
}

```

then inside of the character swap out the movement component with the new one

.h

```auto
// needs constructor (eg. class is called AMyCharacter)
AMyCharacter(const FObjectInitializer& ObjectInitializer);

```

cpp

```auto
/* needed include code */
#include "CharacterMovementComponentEX.h"

AMyCharacter::AMyCharacter(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer.SetDefaultSubobjectClass<UCharacterMovementComponentEX>(CharacterMovementComponentName))
{
// rest of your init code here if needed
}

```

With SetGravDirection you should be able to pass in a vector. Just to a cast to the CharacterMovementComponentEX class before calling the function.

 ![fall up](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/9/a/f9a64f26b663334fdf6008e29173a2954e1cecd1.jpeg)  
 ![fall up 2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/4/8/148bd37ec767900686ad0910b9c0a7ac5c7dea2d.jpeg)  
 ![fallup3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/4/3/3432209aee5159ab33e48aa456c6d82605314ca0.png)

---

_[View the full topic](https://forums.unrealengine.com/t/5-3-default-character-movement-controller-gravity-direction-greyed-out/1356641)._
