Delay in function (for taking screenshots)

I feel like I’m trying to do something unreal really doesn’t want me to do

I am making a mod for palworld that is loaded by UE4SS that takes screenshots of a series of pals - potentially every version of every skeletalmesh for every character ID

This involves getting the skeletalmesh, animation class, animation montage (for multiple montages), and one by one applying them to an actor I created, waiting a few seconds for the textures to pop in, take the screenshot, wait a second for the screenshot to happen , and then go to the next

As far as manually flicking between mesh variants / pals and taking screenshots, that is all done and working fine. What isn’t working is getting the actual workflow operational.

I have all the appropriate code to switch between skeletal meshes, switch between variants, apply whatever modifiers, etc. working in a blueprint. However delay doesn’t work in for loops so I had to create my own loops using spaghetti and branches. However I don’t have a way to get a Delay inside the function.

I have my Mod Actor blueprint that I can Basicly do anything with, how should I be doing this un UE5?

REDUCED EXAMPLE
A function or something I could call from my blueprint, that would print or otherwise out the numbers 1, wait 3 seconds, print “waited”, wait one second, then do the same for 2, 3, 4, etc up to 10. When the cycle is completed, have an execution flow so I can have it do an action (like play a ding)

If your having issues with the function not accepting delay X seconds then run it as a macro.

I’m trying that now. Ran into not having local variables in a macro (which seems arbitrary?) but i figured out I can create local vars as nodes and set them using Assign. I’m trying to figure out how to read them though

If you could provide an example it would be very helpful.


Is this what your talking about? or something else

Sometimes its best to take a step back and think how easy could this code be.

How about making bunch of events (that trigger stages of loading, taking picture etc.) then calling those events on self made timer.

like this:

  • make those events each for separate stage
  • on event tick get game time seconds
  • if that time > “previous game time seconds” + delay step (like 0.2sec) do first event, increase some integer counter, update “previous game time seconds” to current time
  • if that integer counter >= last event id, reset it code is ready for new picture

Yes this is basically what timers would do, but i do not trust timers in unreal. :smiley:

ps. calling event makes it fire and forget, it starts separate blueprint branch.

Break down each step into its own event.

  • Step 1
  • Step 2
  • Step 3
  • etc

Have the finish of an event call the next step.

Step 1… Logic… On finish → Step 2
Step 2… Logic… On finish → Step 3
Step 3… Logic… On finish → Step 4

Functions fire a “return” when they complete. Utilize this instead of “time”.

I don’t know if this helps but there is a setting take a highres screen shot
it took me days to find a youtube.

once it’s open I leave the prompt open on my other screen and just press it when I want any screenshots
I am currently ULTRA frustrated in Twinmotion updated on 7th of Jan 25 the screen shot button
does NOT save anything to the clip board and the render does not trigger the prompt to " create a file name" it only prompts choose your directory ending up of saving the same render again over and over no matter how often I try to follow the media> then details > export
VERY frustrating such simple things not working or having some super unpractival hidden click
that isn’t called for ?