Download

How to get vehicleMovement reference to c++ via blueprint function library?

Hi
How to get vehicleMovement reference working correctly to c++ via blueprint function library to access some variables?

.h


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

#pragma once

#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "../Plugins/Runtime/PhysXVehicles/Source/PhysXVehicles/Public/WheeledVehicleMovementComponent.h"
#include "../Plugins/Runtime/PhysXVehicles/Source/PhysXVehicles/Public/WheeledVehicleMovementComponent4W.h"

 //\Engine\Plugins\Runtime\PhysXVehicles\Source\PhysXVehicles\Public\WheeledVehicleMovementComponent4W.h


#include "MyBlueprintFunctionLibrary.generated.h"



UCLASS()
class TEST2_API UMyBlueprintFunctionLibrary : public UBlueprintFunctionLibrary
{
    GENERATED_BODY()


        UFUNCTION(BlueprintCallable, Category = "Custom")
        static float testVehicle(UWheeledVehicleMovementComponent * vehicle);


};

.cpp


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

#include "MyBlueprintFunctionLibrary.h"


float UMyBlueprintFunctionLibrary::testVehicle(UWheeledVehicleMovementComponent * vehicle)
{
    return vehicle->MaxEngineRPM;
}

Error:


1>------ Build started: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------
2>------ Build started: Project: test2, Configuration: DebugGame_Editor x64 ------
2>Compiling game modules for hot reload
2>Target Platform -- Win64
2>Parsing headers for test2Editor
2>  Running UnrealHeaderTool "D:	estCarFiles\DrivingSchoolDesign 10.24	est2.uproject" "D:	estCarFiles\DrivingSchoolDesign 10.24\Intermediate\Build\Win64	est2Editor\DebugGame	est2Editor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
2>Reflection code generated for test2Editor in 6,3521617 seconds
2>Performing 4 actions (9 in parallel)
2>MyBlueprintFunctionLibrary.gen.cpp
2>MyBlueprintFunctionLibrary.cpp
2>c:\program files\epic games\ue_4.17\engine\plugins\runtime\physxvehicles\source\physxvehicles\public\VehicleWheel.h(14): fatal error C1083: Cannot open include file: 'VehicleWheel.generated.h': No such file or directory
2>c:\program files\epic games\ue_4.17\engine\plugins\runtime\physxvehicles\source\physxvehicles\public\VehicleWheel.h(14): fatal error C1083: Cannot open include file: 'VehicleWheel.generated.h': No such file or directory
2>ERROR : UBT error : Failed to produce item: D:	estCarFiles\DrivingSchoolDesign 10.24\Binaries\Win64\UE4Editor-test2-6847-Win64-DebugGame.dll
2>Total build time: 11,97 seconds (Local executor: 0,00 seconds)
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3075: The command ""C:\Program Files\Epic Games\UE_4.17\Engine\Build\BatchFiles\Build.bat" test2Editor Win64 DebugGame "D:	estCarFiles\DrivingSchoolDesign 10.24	est2.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command.
2>Done building project "test2.vcxproj" -- FAILED.
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

.generated.h" file errors