Up until now, I used Blueprints only for my projects.
I recently started working on a driving game, so I took Epic’s VehicleGame demo as a basis & started developing on top of that.
I soon realized I’ll have to use some C++, so I installed VS2015 & all seemed to go on as planned.
I opened the editor, launched the project, opened the BP for the wheels (named VH_Buggy_WheelBack / VH_Buggy_WheelFront), then clicked on its parent (VehicleWheel) which opened VehicleWheel.h via VS, as planned.
All I did was add ‘BlueprintReadWrite’ to the DampingRate UCOMPONENT. I also (at a later stage) appended some extra text to this component’s description, so I can be sure my changes took place.
I rebuilt the solution, launched the project & opened VH_Buggy_WheelBack - but still saw the old, shorter description on the DampingRate variable (along with it still not being accessible via BP).
When I clicked on its parent again - same old VehicleWheel.h opened in VS, along with the changes I made (but apparently had no effect on what I’m seeing when I’m using the editor).
Tried hitting Compile withing the editor - still, didn’t see my changes take place in VH_Buggy_WheelBack/Front.
What am I missing here?
I bet it’s something really basic & dumb, so I apologize in advance.
I’ll run in shame & take some C++ courses in the meanwhile.
Are you getting any compilling errors?
That might be why nothing changes.
Please complie from Visual Studio then share your results. Also could you post the code so we can see what you changed? If your looking for a good C++ tutorial course try https://www.udemy.com/unrealcourse/learn/v4/overview. I found it very helpful in learning the Unreal API and it offers a quick and dirty Beginner course to C++ if thats what you need aswell.
I didn’t get any compile errors, but I’m also not sure I’m even actually recompiling the files I need to.
All I did was to open this file:
I then changed the DampingRate declaration; this was the original:
/** Damping rate for this wheel (Kgm^2/s) */
UPROPERTY(EditAnywhere, Category = Wheel, meta = (ClampMin = "0.01", UIMin = "0.01"))
This is with my changes:
/** Damping rate for this wheel (Kgm^2/s), should be editable via Blueprint */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Wheel, meta = (ClampMin = "0.01", UIMin = "0.01"))
After adding my changes, I rebuilt the entire Solution (made out of 2 projects - Engine & Games/VehicleGame).
This is the output I’m getting:
1>------ Rebuild All started: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------
2>------ Rebuild All started: Project: VehicleGame, Configuration: Development_Editor x64 ------
2> Cleaning VehicleGameEditor Binaries...
2> Creating makefile for VehicleGameEditor (no existing makefile)
2> Performing full C++ include scan (no include cache file)
2> Parsing headers for VehicleGameEditor
2> Running UnrealHeaderTool "F:\Resources\Unreal Projects\Tutorials and Examples\VehicleGame\VehicleGame.uproject" "F:\Resources\Unreal Projects\Tutorials and Examples\VehicleGame\Intermediate\Build\Win64\VehicleGameEditor\Development\VehicleGameEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
2> Reflection code generated for VehicleGameEditor in 8.6508451 seconds
2> Performing 56 actions (4 in parallel)
2> [4/56] Resource PCLaunch.rc
2> [3/56] Resource ModuleVersionResource.rc.inl
2> [5/56] Resource VehicleGame.rc
2> [7/56] Link UE4Editor-VehicleGameLoadingScreen.lib
2> [8/56] Link UE4Editor-VehicleGameLoadingScreen.dll
2> Creating library F:\Resources\Unreal Projects\Tutorials and Examples\VehicleGame\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-VehicleGameLoadingScreen.lib and object F:\Resources\Unreal Projects\Tutorials and Examples\VehicleGame\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-VehicleGameLoadingScreen.exp
2> Creating library F:\Resources\Unreal Projects\Tutorials and Examples\VehicleGame\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-VehicleGameLoadingScreen.suppressed.lib and object F:\Resources\Unreal Projects\Tutorials and Examples\VehicleGame\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-VehicleGameLoadingScreen.suppressed.exp
2> [55/56] Link UE4Editor-VehicleGame.dll
2> [56/56] Link UE4Editor-VehicleGame.lib
2> Creating library F:\Resources\Unreal Projects\Tutorials and Examples\VehicleGame\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-VehicleGame.lib and object F:\Resources\Unreal Projects\Tutorials and Examples\VehicleGame\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-VehicleGame.exp
2> Creating library F:\Resources\Unreal Projects\Tutorials and Examples\VehicleGame\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-VehicleGame.suppressed.lib and object F:\Resources\Unreal Projects\Tutorials and Examples\VehicleGame\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-VehicleGame.suppressed.exp
2> Deploying VehicleGameEditor Win64 Development...
2> Total build time: 100.28 seconds (Local executor: 57.22 seconds)
========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========
Indeed, I’m not seeing any output from the Engine rebuild (assuming I should see SOME output), & I obviously see no traces of the file I changed (VehicleWheel.h).
I bet I’m missing something really dumb here.
Thanks in any case, I think I can manage learning what I need w/o any paid courses, at least for now. (:
Your right. Sorry you can’t edit engine files as far as i’m aware unless you get the source code from GitHub. The complier won’t complie engine files.
The ideal way todo this is to create a child class of the wheel file then making your changes there.
Then create your own seperate vairable which you can edit in blueprints that then writes over the default value assigned in the parents class.
However i’m not sure if you can write over the default value assigned in the parent class unless that class has a setter function for that particular variable that you can use.
And as such you might need to download the source code from GitHub to make your changes. or rebuild said class from scratch.
Oh, I was convinced that UE4 comes w/ built-in access to its source code.
I thought about creating a child class, but if C++ has the same OO principals as other languages - I don’t think I should be able to change a UCOMPONENT’s access level in an inheriting object.
A setter was my initial approach, but I then found some post of someone saying that all he did was to add BlueprintReadWrite to the component’s signature - and it just worked (exposing this variable to be edited via BP). So I thought I’ll give it a go.
Source code it is, then. I’ll see if anything behaves differently when I try using the source from GitHub.