How to acess UChaosVehicleMovementComponent in C++?

I want to make C++ class inheiriting from AWheeledVehiclePawn,

If that is imporant I’m trying to use ChaosVehicles
AWhelledVehiclePawn creates for you by default SkeletalMesh, which I can acess and edit in code by using GetMesh() then adding a arrow operator but I cannot acess the VehicleMovementComponent.

Neither of public methods (I also don’t understand where there are two of them as both just return VehicleMovementComponent)
GetVehicleMovement() or GetVehicleMovementComponent() work and addind an arrow operator intelisence will tell me that: pointer to incomplete class type UChaosVehicleMovementComponent is not allowed.

How to acess the UChaosVehicleMovementComponent and edit its parametares in C++?

The engine plugin file from which I get those methods is “WheeledVehiclePawn.h”

This error

pointer to incomplete class type UChaosVehicleMovementComponent is not allowed

means that you have not included a header file in which the type you want to perform actions on is declared.

A way to get a component from an actor is by:

YourComponent = YourActor->FindComponentByClass<UYourComponentClass>();
2 Likes

Thank you the exact library I was lokking for turned out to be “ChaosVehicleMovementComponent.h”, reading the engine files is usefull when I dont have Visual Assist

I often use the docs to get the right includes and modules.
Can get it straight from a google search, with keyword "UE4 UChaosVehicleMovementComponent " you get this page:
docs.unrealengine.com * /API * /Class”

UChaosVehicleMovementComponent | Unreal Engine Documentation

3 Likes