• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Scanner doesn't find second instance of object

Community Beginner ,
Jan 16, 2022 Jan 16, 2022

Copy link to clipboard

Copied

Hello,

 

I have a simple script that checks if an object exists on the stage and returns that objects properties. However, this script only works during the first time the object is tested. If i delete the object from the stage, and add it back later on in the timeline, the object is no longer found. 

 

chriss97299627_0-1642349574604.png

 

chriss97299627_1-1642349615633.png

 

chriss97299627_2-1642349669759.png

 

Here is a code sample. Is there some way to delete the object and recreate it for the scanning feature to function?

 

https://drive.google.com/file/d/1fFEMDH80YPql0su2UOtnRkWgd4DbpZCP/view?usp=sharing

Views

105

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 16, 2022 Jan 16, 2022

Copy link to clipboard

Copied

Is there any help on this? I've been trying for months to figure this out. This is extremely simple in a modern programming language. all i want to do is:

 

1. Check if an object exists.

 

2. Return that object's properites.

 

If the object has not been declared, it throws an error. There is no built in function to check if an object exists. Also, I can't use the same object more than once; the scanner won't find it. Please help, this should not be this hard.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 16, 2022 Jan 16, 2022

Copy link to clipboard

Copied

LATEST

There should be no need to "scan" for your object existing. If you create the object at author time, give it an instance name, then you should be able to just check whether an object with that name exists. Likewise, if you dynamically create it at runtime, assign a property with its name to its container object.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines