Issues when adding two of the same conveyors

Typically: "How do I... ", "How can I... " questions
Post Reply
jaykumar
Posts: 8
Joined: 22 Oct 2020, 00:27

Issues when adding two of the same conveyors

Post by jaykumar »

Hello,

I am having issues whenever I insert two of the same conveyors on my scene. I am testing out how to stop the conveyor when the proximity sensor detects the block. But whenever I add the same type of conveyor it gives me the error below

[ConveyorBelt#0@childScript:error] 3: Object does not exist. (in function 'sim.getObjectHandle')
stack traceback:
[C]: in function 'getObjectHandle'
[string "ConveyorBelt#0@childScript"]:3: in function <[string "ConveyorBelt#0@childScript"]:1>

I am not sure what is wrong cause it works when there are two types of conveyors. By type, I mean the customizable conveyor and the conveyorbelt.

This is the link to my scene https://drive.google.com/file/d/1cDAgf_ ... sp=sharing

Thank you, Jay

jaykumar
Posts: 8
Joined: 22 Oct 2020, 00:27

Re: Issues when adding two of the same conveyors

Post by jaykumar »

Actually figured it out, this is my solution in case anyone has the same issue. When calling a proximity sensor under sysCall_init, you want to use a "#" sign after the proximity sensor. For example

psensor=sim.getObjectHandle('Proximity') for the first Proximity sensor
psensor1=sim.getObjectHandle('Proximity1#') for the second Proximity sensor.

This made my scene work and do what it was supposed to do. Hope this helps.

Thanks, Jay

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

Re: Issues when adding two of the same conveyors

Post by coppelia »


jaykumar
Posts: 8
Joined: 22 Oct 2020, 00:27

Re: Issues when adding two of the same conveyors

Post by jaykumar »

Yes, that is where I figured out how to solve this issue, Thank you for the help.

Thanks, Jay

Post Reply