<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: delay in Lua in Stingray Forum (Read Only)</title>
    <link>https://forums.autodesk.com/t5/stingray-forum-read-only/delay-in-lua/m-p/5931611#M2489</link>
    <description>&lt;P&gt;You would do something similar to below. Rotate your unit, then set it back to local 000 when done. You can set it back over time to make it more smooth if you like as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/203981iC481CADF6BC01A8E/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="rotateback.JPG" title="rotateback.JPG" /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Dec 2015 20:23:01 GMT</pubDate>
    <dc:creator>dan.matlack</dc:creator>
    <dc:date>2015-12-01T20:23:01Z</dc:date>
    <item>
      <title>delay in Lua</title>
      <link>https://forums.autodesk.com/t5/stingray-forum-read-only/delay-in-lua/m-p/5926528#M2425</link>
      <description>&lt;P&gt;Hi everyone.&lt;/P&gt;&lt;P&gt;How to use delay within a while loop in a function is triggered by releasing a keypress (for ex: R)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2015 20:23:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/stingray-forum-read-only/delay-in-lua/m-p/5926528#M2425</guid>
      <dc:creator>ebo134</dc:creator>
      <dc:date>2015-11-26T20:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: delay in Lua</title>
      <link>https://forums.autodesk.com/t5/stingray-forum-read-only/delay-in-lua/m-p/5927372#M2432</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Can you take a step back and describe what you're trying to accomplish at a higher level? and why you want to do this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't think that what you're envisioning can possibly work due to the nature of the game engine update loop. Basically while the game engine is running, it does a single big update loop over and over (60 times a second if it's running at 60fps, for example.). Each time that main loop runs, the game collects input from controllers, does a whole bunch of other tasks to update the current state of the stuff in the game world, then renders the current state of the world out to the viewport.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, every bit of custom Lua code that you write in your game project executes WITHIN ONE of those frames. So, if your custom function sits in a "while" loop for five seconds without breaking, your game will freeze on the current frame until your function is done. Maybe that's the effect you want. However, the problem comes in when you want to quit the loop based on receiving new input. While your function is looping, the main game loop is paused. Therefore, the part of the main loop that reads input from the keyboard and other controllers doesn't get run. So there's no way for your function to detect new keypresses.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2015 18:00:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/stingray-forum-read-only/delay-in-lua/m-p/5927372#M2432</guid>
      <dc:creator>_robbs_</dc:creator>
      <dc:date>2015-11-27T18:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: delay in Lua</title>
      <link>https://forums.autodesk.com/t5/stingray-forum-read-only/delay-in-lua/m-p/5927387#M2433</link>
      <description>&lt;P&gt;ok. what the mean of delay in flow then, can you explain what does the delay node do, and how it works within a while loop?&lt;/P&gt;&lt;P&gt;how to build a custom flow node to recenter back a rotation of a unit after releasing the key D, I want it to be automatically .&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2015 18:28:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/stingray-forum-read-only/delay-in-lua/m-p/5927387#M2433</guid>
      <dc:creator>ebo134</dc:creator>
      <dc:date>2015-11-27T18:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: delay in Lua</title>
      <link>https://forums.autodesk.com/t5/stingray-forum-read-only/delay-in-lua/m-p/5927388#M2434</link>
      <description>&lt;P&gt;When you call the Delay node in Flow, it doesn't block the game from proceeding. It stops the Flow graph from evaluating farther within the current frame, and it essentially schedules an event that will make the graph resume after the desired amount of time has passed. Meanwhile, it lets the game loop go on normally. Every frame it says, "Has the delay time elapsed yet?" If no, it goes back to waiting. If yes, it jumps in and finishes the flow graph.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2015 18:32:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/stingray-forum-read-only/delay-in-lua/m-p/5927388#M2434</guid>
      <dc:creator>_robbs_</dc:creator>
      <dc:date>2015-11-27T18:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: delay in Lua</title>
      <link>https://forums.autodesk.com/t5/stingray-forum-read-only/delay-in-lua/m-p/5930175#M2473</link>
      <description>You would use a key released node to then start a flow chain wherein you find your unit, get its rotation and then set the rotation over delta time to its original orientation. You can do all that in flow now without creating a custom node.</description>
      <pubDate>Mon, 30 Nov 2015 21:57:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/stingray-forum-read-only/delay-in-lua/m-p/5930175#M2473</guid>
      <dc:creator>dan.matlack</dc:creator>
      <dc:date>2015-11-30T21:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: delay in Lua</title>
      <link>https://forums.autodesk.com/t5/stingray-forum-read-only/delay-in-lua/m-p/5930238#M2479</link>
      <description>please,can you show me a snapshot? just the portion of rotation back.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Mon, 30 Nov 2015 22:47:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/stingray-forum-read-only/delay-in-lua/m-p/5930238#M2479</guid>
      <dc:creator>ebo134</dc:creator>
      <dc:date>2015-11-30T22:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: delay in Lua</title>
      <link>https://forums.autodesk.com/t5/stingray-forum-read-only/delay-in-lua/m-p/5931611#M2489</link>
      <description>&lt;P&gt;You would do something similar to below. Rotate your unit, then set it back to local 000 when done. You can set it back over time to make it more smooth if you like as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/203981iC481CADF6BC01A8E/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="rotateback.JPG" title="rotateback.JPG" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2015 20:23:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/stingray-forum-read-only/delay-in-lua/m-p/5931611#M2489</guid>
      <dc:creator>dan.matlack</dc:creator>
      <dc:date>2015-12-01T20:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: delay in Lua</title>
      <link>https://forums.autodesk.com/t5/stingray-forum-read-only/delay-in-lua/m-p/5931620#M2491</link>
      <description>No, Sorry this is not overtime,I already know the node of rotation,I want the trick part how to connect it to get last delta time and keeping on until the rotation to be 000, kindly show me this part.</description>
      <pubDate>Tue, 01 Dec 2015 20:26:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/stingray-forum-read-only/delay-in-lua/m-p/5931620#M2491</guid>
      <dc:creator>ebo134</dc:creator>
      <dc:date>2015-12-01T20:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: delay in Lua</title>
      <link>https://forums.autodesk.com/t5/stingray-forum-read-only/delay-in-lua/m-p/5931726#M2498</link>
      <description>I'm so sorry ebo, I am not understanding what it is you want. Can you try to be more specific? &lt;BR /&gt;&lt;BR /&gt;You want your object to rotate back to 000 over a certain time period that you set and can control the speed of?</description>
      <pubDate>Tue, 01 Dec 2015 21:34:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/stingray-forum-read-only/delay-in-lua/m-p/5931726#M2498</guid>
      <dc:creator>dan.matlack</dc:creator>
      <dc:date>2015-12-01T21:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: delay in Lua</title>
      <link>https://forums.autodesk.com/t5/stingray-forum-read-only/delay-in-lua/m-p/5931751#M2499</link>
      <description>&lt;P&gt;ok, assume a cube mesh rotated by 30 degree in y axis by pressing D key, after releasing D key I want the angle in y axis to be 0 degree (but zero outing the angle with time like how gravity works with vertical distance), it does not matter rate of zero outting the angle say for example 1 degree /frame , more or less.The important thing is process of rotating back to zero angle with time .&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2015 21:49:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/stingray-forum-read-only/delay-in-lua/m-p/5931751#M2499</guid>
      <dc:creator>ebo134</dc:creator>
      <dc:date>2015-12-01T21:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: delay in Lua</title>
      <link>https://forums.autodesk.com/t5/stingray-forum-read-only/delay-in-lua/m-p/5931861#M2500</link>
      <description>&lt;P&gt;This will work as intended for you as far as I can tell. Right click and open in new tab to see full resolution. Let me know if this is what you needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/204010i658A7F469EB349C8/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="rotateANDback.JPG" title="rotateANDback.JPG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/204011i9E6DBD19AF781576/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="rotategif.gif" title="rotategif.gif" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2015 23:23:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/stingray-forum-read-only/delay-in-lua/m-p/5931861#M2500</guid>
      <dc:creator>dan.matlack</dc:creator>
      <dc:date>2015-12-01T23:23:21Z</dc:date>
    </item>
  </channel>
</rss>

