# \[VehicleGame\] How to change VehicleMovementComponent to custom one?

**URL:** <https://forums.unrealengine.com/t/vehiclegame-how-to-change-vehiclemovementcomponent-to-custom-one/361824>\
**Category:** World Creation\
**Tags:** vehicle, vehiclemovementcompo, custom-component, unreal-engine, Components, question\
**Created:** [June 23, 2016, 4:16pm UTC](https://forums.unrealengine.com/t/vehiclegame-how-to-change-vehiclemovementcomponent-to-custom-one/361824 "2016-06-23T16:16:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cpt.Trips](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cpt.Trips](https://forums.unrealengine.com/u/Cpt.Trips)\
**Post date:** [June 23, 2016, 4:16pm UTC](https://forums.unrealengine.com/t/vehiclegame-how-to-change-vehiclemovementcomponent-to-custom-one/361824/1 "2016-06-23T16:16:24Z")

</div>

I wanted to add some updates to the custom Vehicle Movement component in the VehicleGame demo, that is in Pawns/VehicleMovementComponentBoosted4w.h/cpp

but I noticed the buggy pawn does not seem to use that component at all, instead utilizing VehicleMovementComponent4w

How can I set it up to actually use VehicleMovementComponentBoosted4w instead - or any other custom movement component derived from the default one?

---

<div class="post-metadata">

**Author:** ![Gelani](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gelani](https://forums.unrealengine.com/u/Gelani)\
**Post date:** [June 23, 2016, 4:43pm UTC](https://forums.unrealengine.com/t/vehiclegame-how-to-change-vehiclemovementcomponent-to-custom-one/361824/2 "2016-06-23T16:43:44Z")

</div>

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.

```
#include "Pawns/VehicleMovementComponentBoosted4w.h"

ABuggyPawn::ABuggyPawn(const class FObjectInitializer& PCIP) :
Super(PCIP.SetDefaultSubobjectClass<UVehicleMovementComponentBoosted4w>(AWheeledVehicle::VehicleMovementComponentName))
{
}
```

---

<div class="post-metadata">

**Author:** ![Cpt.Trips](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cpt.Trips](https://forums.unrealengine.com/u/Cpt.Trips)\
**Post date:** [June 24, 2016, 1:55am UTC](https://forums.unrealengine.com/t/vehiclegame-how-to-change-vehiclemovementcomponent-to-custom-one/361824/3 "2016-06-24T01:55:42Z")

</div>

Thank you, that worked just fine. Although one issue I’m having is this: in the vehicle Blueprint the component displays the proper parent (“VehicleMovementComponentBoosted4w”), but when I try to access properties added in the “boosted4W” class, I have to cast the VehicleMovementComponent to VehicleMovementComponentBoosted4w.

Here is my class declaration:

```
UCLASS()
class UVehicleMovementComponentBoosted4w : public UWheeledVehicleMovementComponent4W
{
	GENERATED_UCLASS_BODY()

	UFUNCTION(BlueprintCallable, Category = "Game|Vehicle")
	void Test1();

public:
	UFUNCTION(BlueprintCallable, Category = "Game|Vehicle")
	void Test2();
};

```

Both, test1 and test2 are only accessible after casting as seen in the screenshot below.  
Is that to be expected or do I need to change code declaration?

 ![95839-4w.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/a/7/ea7a1cd2cc0814f17da160239d1fc603c7e624d2.jpeg)

---

<div class="post-metadata">

**Author:** ![Gelani](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gelani](https://forums.unrealengine.com/u/Gelani)\
**Post date:** [June 24, 2016, 11:10am UTC](https://forums.unrealengine.com/t/vehiclegame-how-to-change-vehiclemovementcomponent-to-custom-one/361824/4 "2016-06-24T11:10:25Z")

</div>

It is not issue. I must cast the VehicleMovementComponent to VehicleMovementComponentBoosted4w.
