Fandom

SketchyPhysicsWiki

SP 27 June scripting

103pages on
this wiki
Add New Page
Talk0 Share

This new version, is ready to use actual Ruby API script using the Scripted Field. Also, it has a new feature: Density.


Some working scripts Edit

Breakable Objects:

  • ontouch{split(self,0)}

Note: You can change the 0 to 1, 2, 3... If the number is above 5, SketchUp will crash.


Teleportation: ontouch{|toucher,speed,pos|

if toucher.name=="sphere"

toucher.teleport(toucher.position+[-500,0,0])

end

}

Note: The object will teleport ONLY if it is called 'Sphere', to change it, go to Right Click > Entity Info > Name.


OnClick Scripts:

Note: There are a few onClick Scripts, here are some:

  • onclick{
  • split(self,1)
  • }


  • onclick{
  • destroy
  • }

Some Commands Edit

According to a pre-release post in the forum, these are some commands

onstart=Start of simulation
onend=End of sim
ontick=Same as current OnTick
ontouch=Two objects start touching
onuntouch=Two object stop touching
touching=Same as current OnTouch
OnKeyDown=Called once when the user presses a key
OnKeyUp=Called once when the user releases a key

--Sgal93 21:01, 2 July 2009 (UTC)

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.