[Python]Please help me delete an object with name

You know the name of the object you want to delete. Can I delete a specific object based on its name alone?

In Python

help

The Koblox code is like this.
image

Deleting an item named Bear

Hi @jeny2026 ,

This code removes the bear in the start.
To delete the bear by clicking on it, use the commented code (bear.input.on_click(bear.delete))

bear = scene.get_item("U362gzUG")

def remove(item):
    item.delete()

remove(bear)
# bear.input.on_click(bear.delete)

Hope this helps,
pavlina

1 Like

Thank you for answer.
What I’m curious about is whether it is possible to delete an object using its name.
When there are multiple replicas, give the replicas a name,
I want to delete a duplicate object with a specific name.
For example, when I press the red button, I want to delete the duplicate object named “copide_girl5”.
I want to know how to give commands to an object using the name of the clone.
I’m studying Python. help

Please check this out DGP-HAU

2 Likes

oh!! Solved.!! thank you :heart_eyes:

1 Like