Moving objects
-
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 -
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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better đź’—
Register LoginAdvertisement