Script to limit the rotation of a hinge?

If you have problems installing or running Algodoo, have found a bug or need in-game help - this is it!

Script to limit the rotation of a hinge?

Postby Holcomb » Thu Nov 01, 2012 6:23 am

I know you can limit the rotation using shapes to physically stop the rotation, but I want to know if there is a script to do it. I would like to rotate a wheel a set amount of degrees clockwise and counterclockwise. I've looked for a while and can't find anything.
Holcomb
 
Posts: 2
Joined: Thu Nov 01, 2012 5:14 am

Re: Script to limit the rotation of a hinge?

Postby Nxdt » Fri Nov 02, 2012 12:31 am

set angvel = 0, or something like that.
I don't quite remember but;

Put this code in a laser or something in the onlaserhit script box.
Code: Select all
e.other.angvel = 0

or
Code: Select all
e.geom.angvel = 0
User avatar
Nxdt
 
Posts: 1019
Joined: Mon Aug 31, 2009 6:32 pm
Location: Scotland!

Re: Script to limit the rotation of a hinge?

Postby Holcomb » Fri Nov 02, 2012 5:31 am

Thanks I'll try it out. I'm just hoping it wont set the rotation limit to the individual shape. I'd rather have the hinge limit the rotation so the entire object can still rotate freely.
Holcomb
 
Posts: 2
Joined: Thu Nov 01, 2012 5:14 am

Re: Script to limit the rotation of a hinge?

Postby Kilinich » Fri Nov 02, 2012 8:27 am

not that easy
I've try to use script similar to my ratchet, it's not so effective. Hinge still moving ...
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia


Return to Help / Bug reports

Who is online

Users browsing this forum: No registered users and 5 guests