• Login
sketchucation logo sketchucation
  • Login
⚠️ Libfredo 15.4b | Minor release with bugfixes and improvements Update

Moving objects

Scheduled Pinned Locked Moved SketchyPhysics
2 Posts 2 Posters 412 Views 2 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    Derek mason
    last edited by 17 Nov 2011, 15:25

    Hi
    I want to move a box down a packing line and send it at 90 degrees at the end. I can send it down the line but how do i make it change direction and keep moving

    1 Reply Last reply Reply Quote 0
    • M Offline
      mptak
      last edited by 18 Nov 2011, 14:55

      Push works well. Something like this inside the Sketchy Physics UI for the object.

      xpos=0.0
      ypos=0.0
      xturn=150.0
      yturn=150.0
      ontick{
      if frame%60 == 0
          if xpos < xturn || ypos > yturn
            push([1,0,0])
            puts ("pushx")
          else
            push([0,2,0])
            puts ("pushy")
          end
          xpos=position().x
          ypos=position().y
          puts(ypos)
      end
      }
      

      This will push towards the x direction for awhile then push towards the y and then back to the x. You could also change the logic so the push direction changed based on touching the bumpers using the ontouch event.


      downtrack.skp

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      1 / 1
      • First post
        1/2
        Last post
      Buy SketchPlus
      Buy SUbD
      Buy WrapR
      Buy eBook
      Buy Modelur
      Buy Vertex Tools
      Buy SketchCuisine
      Buy FormFonts

      Advertisement