Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added time dilation to pause entire world on simPause() #2256

Closed
wants to merge 1 commit into from

Conversation

msb336
Copy link
Contributor

@msb336 msb336 commented Oct 15, 2019

This will close a lot of issues requesting simPause to pause all animations in the world along with the player controlled character.

@madratman
Copy link
Contributor

madratman commented Nov 4, 2019

Closing in favor of #2282. unreal's sim pause game / set global dilation should be called in simmodeworldbase.cpp instead of simmodebase.cpp.

with this PR, on hitting sim Pause, I see a warning in the unreal console:

[2019.11.04-18.52.25:101][434]LogBlueprintUserMessages: Warning: Time Dilation must be between 0.000100 and 20.000000.  Clamped value to that range.

this hints that the game is not actually paused, but it's going on really slow at 1e-4 rate.

Googling this a bit yields https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/7217-slowmo-and-game-pause-via-blueprints-tutorial
quoting a relevant snippet from the above article:


Prepare the same set up as you did for the slow motion but replace the event with the one associated with your pause button. Change the time dilation in the node A to 0, compile and run the map. Unfortunately, when you hit the pause button, you can still see the ball moving. So, what's happened? Well, "Set Global Time Dilation" node cannot set Time Dilation to 0 as it will break some internal logic and will cause many other issues. When you set it to 0, it will automatically defaulted to a very small but non-zero number. In order to truly pause the game, we will need a "Set Game Paused" node (Call Function->Game->Set Game Paused). Replace our "Set Global Time Dilation" nodes with the "Set Game Paused" nodes and put the tick in the box of the one connected to the output "A" of the flip flop connected to the "Pause" event.

which finally yields the right API we should use SetGamePaused/: https://docs.unrealengine.com/en-US/API/Runtime/Engine/Kismet/UGameplayStatics/SetGamePaused/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants