I currently work on a project where the core gameplay is implemented but, since it is physics-based, now needs lots and lots of fine-tuning (several variables in the physics manipulation blueprints, weight of actor, center of mass offset, damping…).
My current “workflow” is:
hit the play button
play a few seconds / minutes
change one (or two) variables a bit
start from the beginning
I was wondering, therefore, if there is a way to manipulate variables during runtime, in order to see the effect of changes more quickly? Is there an option in UE4 or a plugin for this purpose?
I am asking since I can’t be the first to experience this challenge and my do-it-yourself plan seems to be much work for something which will not be part of the game later:
Creating a UI which exposes all relevant variables
Creating blueprints which forward changes in UI to the real variables (if this is even possible during gameplay!)
A save functionality which stores changes in variables so that changes are not lost when game window is closed (and the changed values can be loaded the next time)
You can simulate rather than running the game, works the same as using F8 to inspect from a remote camera. Wont work for items with a player controller though, they will stop at that point.
You could also drop a BP actor in the world which takes configuration info from a widget.
Very late, but for anyone tuning a physics pawn who finds this:
- Put the tuning values in a Data Asset that the pawn reads when it needs them, not once at BeginPlay. While PIE runs you can open the asset, change the numbers, and the game uses them right away. They also stay changed after you stop, which covers the “save the tuned values” part of your plan for free.
- Mass, damping and center of mass have to go through their functions (SetMassOverrideInKg, SetLinearDamping, SetCenterOfMass) to reach the running physics body. Just changing the variable won’t do it.
And the plugin you asked about exists now. I made it, so I’m biased: Actor Console (UE 5.6+). While playing you can type @MyPawn.Mesh.SetLinearDamping(0.5) or @MyPawn.ThrustForce 1500, with autocomplete for all the names, and ++@MyPawn.ThrustForce graphs a value on screen while you fly around. Actor Console | Fab