How to disable position control within a child script.

Typically: "How do I... ", "How can I... " questions
Post Reply
rab
Posts: 3
Joined: 19 Feb 2013, 16:01

How to disable position control within a child script.

Post by rab »

Hello,

Is it possible to enable and disable "position control" from this path (Scene Object Properties/Show Dynamic Parameters/Control Parameters) WITHIN a Non-treaded child script using code? I cant seem to find it in your manual if it´s possible.

Regards, Rab

coppelia
Site Admin
Posts: 7936
Joined: 14 Dec 2012, 00:25

Re: How to disable position control within a child script.

Post by coppelia »

Hello Rab,

Have a look at following API function (with those parameters):

simSetObjectIntParameter(jointHandle,2001,0) -- disables position control of that joint

Cheers

rab
Posts: 3
Joined: 19 Feb 2013, 16:01

Re: How to disable position control within a child script.

Post by rab »

Thank you for your response, this worked quite nicely.

One more question though, or correct me if Im wrong.

As I understand this I use this command
simSetObjectIntParameter(jointHandle,2001,0)
to disable the position control and that works.
And this command to enable it again.
simSetObjectIntParameter(jointHandle,2001,!=0)

However when I try the second command I get the following error.
Lua compilation error: [string "SCRIPT Foot_L"]:70: unexpected symbol near '!'

Am I doing it wrong?

coppelia
Site Admin
Posts: 7936
Joined: 14 Dec 2012, 00:25

Re: How to disable position control within a child script.

Post by coppelia »

To enable it again, use:

simSetObjectIntParameter(jointHandle,2001,1)

Also remember: "!=" doesn't exist in Lua. Use "~=" instead

Cheers

Post Reply