Trying to get wheels from AwheeledVehiclePAwn in C++

Hi there!
I am working on a base class for my vehicle class inherited from AwheelVehiclePawn
so I can move some BP logic to the base class.
I cant figure out how to get the wheels in C++
here is the BP equivalent:

image

``
include “…/ACTORS/Car_CPP.h”

include

ACar_CPP::ACar_CPP() { PrimaryActorTick.bCanEverTick = true; }

void ACar_CPP::BeginPlay() { Super::BeginPlay(); }

void ACar_CPP::Tick(float DeltaSeconds) { Super::Tick(DeltaSeconds); }

bool ACar_CPP::isCarInTheAir(bool& inTheAir)
{
bool isInTheAir = true;
// here I want to get the Wheels Array from its base class
}

``
thanks

why cant access to variables and functions of this component?

GetVehicleMovementComponent returns a base (non-wheeled) chaos vehicle component, cast it to UChaosWheeledVehicleMovementComponent to access Wheels.

1 Like

Thanks @Chatouille :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.