Hey guys how can I read protected variables? I just want to get UWheeledVehicleMovementComponent BrakeInput for brake lights but getting the inaccessible error.
Protected means that you can only access it in child classes derived from the class.
CalcBrakeInput() is also private so I couldn’t access that either. But solved the issue by recreating the same function inside the blueprint.
As Althaen said, you can’t directly access BrakeInput as it is a protected variable. However if you look in WheeledVehicleMovementComponent.h there is a function called CalcBrakeInput() that is effectively a getter for the BrakeInput variable. It’s also public so it can be called from outside the class.
API: UWheeledVehicleMovementComponent::CalcBrakeInput | Unreal Engine Documentation