<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[SketchyPhysics Keyboard Controls]]></title><description><![CDATA[<p dir="auto">Hi all,</p>
<p dir="auto">discussion on sketchyphysics sure seems to have cooled off since I was last in this part of the forum 2 years ago - thats a shame, over the last few days I have been using SP to model a proposed walking machine and it really is an extraordinary plugin.</p>
<p dir="auto">I have a couple of questions for you folks that are more familiar with SP and Ruby:</p>
<ol>
<li>Using (rightx) how do I get servo to sit in a position and stay there without spring loading back to its midway point? I am lifting a leg with the servo, pressing one arrow raises the leg and pushing the opposing arrow lowers the leg but if I release the arrow at any time the leg springs back to the middle position. How can I set things up so the leg maintains it's position when I release the arrow key? Currently the controller says this:</li>
</ol>
<pre><code>slider('A2_Tilt',0)+(rightx)
</code></pre>
<ol start="2">
<li>Is there a way to apply the same set of keys for certain objects and toggle between them, for example my walking machine has four legs. I can use (rightx) and (righty) to lift and place one leg - is there a way that I can set up a toggle function to apply those keys to each leg in real time so I can move each one individually? IE press spacebar so that the (rightx) and (righty) functions apply to the next leg on the machine?</li>
</ol>
<p dir="auto">Any help is much appreciated - I love the plugin and would pay for it if it would encourage Cphillips and co in their endeavours (you can't work for free) <img src="https://community.sketchucation.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f609.png?v=6529dfcbe5e" class="not-responsive emoji emoji-android emoji--wink" style="height:23px;width:auto;vertical-align:middle" title=":wink:" alt="😉" /></p>
<p dir="auto">Thanks</p>
<p dir="auto">Ash</p>
]]></description><link>https://community.sketchucation.com/topic/134258/sketchyphysics-keyboard-controls</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 22:40:32 GMT</lastBuildDate><atom:link href="https://community.sketchucation.com/topic/134258.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 04 Apr 2012 11:02:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to SketchyPhysics Keyboard Controls on Tue, 24 Apr 2012 07:51:58 GMT]]></title><description><![CDATA[<p dir="auto">There is a much better answer than using a motor to place a joint where you want it - you need to use a servo and a little ruby script</p>
<p dir="auto">Step1: place your servo within the group you want to move and attach it to a base group<br />
Step2: select the servo and open the sketchyphysics UI<br />
Step3: within the UI apply the following settings<br />
[list=]min:0<br />
max:1<br />
accel:4000<br />
damp:1000<br />
controller:@servo1 (you can actually call it anything starting with @<br />
[/list]<br />
Step4: Select the base of your model and open the sketchyphysics UI<br />
Step5: place the following rubyscript in there:</p>
<pre><code>if frame&lt;1.00
@servo1=0.00
end
# this allows servo to incrementally increase based on joystick input (righty) you can change it to any of the joystick axes
@servo1+=(0.5-righty)
# this sets range of movement for the servo as it is not set in the servo's UI
if @servo1&gt;45;@servo1=45;end
if @servo1&lt;-45;@servo1=-45;end

</code></pre>
<p dir="auto">It took me a long time to work this out (reverse engineering another model) so I am more than happy to help anyone out with it if these instructions are too hard to follow.</p>
<p dir="auto">I believe this is a very powerful function in sketchyphysics and I have only seen it in one model in the 3DWH</p>
]]></description><link>https://community.sketchucation.com/post/1323818</link><guid isPermaLink="true">https://community.sketchucation.com/post/1323818</guid><dc:creator><![CDATA[ashscott]]></dc:creator><pubDate>Tue, 24 Apr 2012 07:51:58 GMT</pubDate></item><item><title><![CDATA[Reply to SketchyPhysics Keyboard Controls on Sat, 14 Apr 2012 05:03:43 GMT]]></title><description><![CDATA[<p dir="auto">Answers to these questions:</p>
<ol>
<li>Use a motor not a servo</li>
<li>Toggling between keys looks something like this:</li>
</ol>
<pre><code>if key("m")==1
@B1_Tilt=(righty) and @B1_Twist=(0.5-rightx) and @B1_Ext=key("b")
elsif key("m")==0 and key("n")==0
@stick=0.5-(righty)

</code></pre>
<p dir="auto">If I hold down ("m") the joystick controls a different set of functions than if I hold down ("n"). I also have another set of functions for the joystick if no key is pressed so I have three joysticks in one.</p>
<p dir="auto">"m" and "n" have been assigned to my second joystick using the software 'joytokey' which I highly recommend. It allows you to set functions to the keyboard but then run them through a second joystick to your primary joystick.</p>
<p dir="auto">Thus, I am running my sketchyphysicks sim with a logitech attack3 joystick in each hand.</p>
<p dir="auto">It is an industrial simulation and I haven't seen anything else like it done online. I can't share more because its under NDA but if anyone wants help with something like this then let me know.</p>
<p dir="auto">Ash</p>
]]></description><link>https://community.sketchucation.com/post/1321865</link><guid isPermaLink="true">https://community.sketchucation.com/post/1321865</guid><dc:creator><![CDATA[ashscott]]></dc:creator><pubDate>Sat, 14 Apr 2012 05:03:43 GMT</pubDate></item></channel></rss>