You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@iUltimateLP you can use coroutines. Start by wrapping (you have various ways) the sequence of moves in a coroutine:
localrobot= {}
functionrobot.actions()
-- get the currently running coroutinecoro=coroutine.running()
print('actions!')
-- pass the 'coro' to the blueprint to allow resuming laterrobot_up(coro)
print('first step done')
-- this yield will suspend the coroutine, it will be resumed by the previous blueprintcoroutine.yield()
-- and again...robot_up(coro)
print('second step done')
coroutine.yield()
-- and again...robot_up(coro)
print('end of coroutine')
endreturnrobot
the robot_up function is a blueprint event (note how it calls the resume over the passed coroutine):
you can directly spawn coroutine from blueprint/c++ (otherwise just use lua):
Hey, I want to use this to implement robots in my puzzle game.
An example Lua code would look like this:
As you can see, I'd need the calls to be "blocking", or non-returning until the robot fully finished moving. Is that possible? Thanks!
The text was updated successfully, but these errors were encountered: