Access variable in UE4 source code by method of my project - need help

Hello guys,

I have modified the UE4 method *float FPhysSubstepTask::UpdateTime(float UseDelta) * in PhysSubstep.cpp

I would like now to switch the modification on and off by a method of my own project.
So if there was a bool-variable in the *UpdateTime *method I would like to change the value of that bool from outside.

How can I do that? Can this bool be made global? Can I use a blueprint?

Any ideas how to solve the problem would be very welcome!

Thank you in advance!

There are lots of ways…

Maybe configure a console variable so you can change it while in game?

Also - Looks like that function is already reading UPhysicsSettings. Maybe just add your bool to that?

sounds good that there are alot of ways :slight_smile: I just need one!
You mean I can put my bool in UPhysicsSettings and can access it from the game code?
How can I do that…
Could you please be more specific please?

So you can access it via the global accessor they are using, eg.:

UPhysicsSettings * PhysSetting = UPhysicsSettings::Get();
PhysSetting->MyBool = true;

Be sure to add MyBool to PhysicsSetting.h:

UPROPERTY(config, EditAnywhere, Category = Constants)
bool MyBool;

You will of course have to rebuild the engine after this.

After this, you may even be able to edit it in menu …ProjectSetting…Physics…Constants

yeaaaahh!!! it works!!! Thank you so much, you made my day :smiley: