Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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
    Code:
    // 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
    Code:
    // Fill out your copyright notice in the Description page of Project Settings.
    
    #include "MyBlueprintFunctionLibrary.h"
    
    
    float UMyBlueprintFunctionLibrary::testVehicle(UWheeledVehicleMovementComponent * vehicle)
    {
        return vehicle->MaxEngineRPM;
    }
    Error:
    Code:
    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:\testCarFiles\DrivingSchoolDesign 10.24\test2.uproject" "D:\testCarFiles\DrivingSchoolDesign 10.24\Intermediate\Build\Win64\test2Editor\DebugGame\test2Editor.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:\testCarFiles\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:\testCarFiles\DrivingSchoolDesign 10.24\test2.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
    Last edited by UE567; 10-26-2017, 04:06 AM.
Working...
X