Skip to content

Instantly share code, notes, and snippets.

@rondreas
Created Mar 15, 2021
Embed
What would you like to do?
Example of Timer in Unreal
"""
Start a timer to call the function "hey" every half second.
Have yet to figure out how to kill this...
"""
import unreal
@unreal.uclass()
class MyTimedUtility(unreal.EditorUtilityObject):
@unreal.ufunction(override=True)
def run(self):
self.timer_handle = unreal.SystemLibrary.set_timer(
object = self,
function_name="hey",
time=0.5,
looping=True,
)
@unreal.ufunction()
def hey(self):
print("Hey")
my_timed_utility = MyTimedUtility()
my_timed_utility.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment