How can i remove objects from the scene

Typically: "How do I... ", "How can I... " questions
Post Reply
dkchaisumdet
Posts: 12
Joined: 19 Mar 2023, 06:27

How can i remove objects from the scene

Post by dkchaisumdet »

Hello,

When i try to remove objects this way I get an error

27: in sim.removeObjects: one of the function's argument type is not correct.

Code: Select all

function sysCall_actuation()
    shapeHandle=sim.getObject('/Shape',{noError=true})
    if(not sim.isHandle(shapeHandle)) then
   createdShape=simSurfRec.reconstruct_scale_space(pointCloudHandle,4,12,300,0.001)
    shapeHandle=sim.getObject('/Shape')
    else
    
    sim.removeObjects(shapeHandle)

    --local createdShape=simSurfRec.reconstruct_scale_space(pointCloudHandle,4,12,300,0.001)
    end
end
Thanks

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

Re: How can i remove objects from the scene

Post by coppelia »

Hello,

sim.removeObjects expects a table as argument. So instead of sim.removeObjects(objectHandle), do sim.removeObjects({objectHandle})

Cheers

Post Reply