get_object_by_name() returning a not found error
25 February 2016 11:49
25 February 2016 12:20
25 February 2016 13:02
Yes!!! That worked, thank you so much. Could you please explain why I had to do this for it to work?
The second parameter is needed for dynamically loaded objects. You can load a single scene many times, so there would be many objects with the same name. Data_id helps to uniquely identify these objects. If an object belongs to the main scene its data_id is 0, objects from the first dynamically loaded scene have data_it set to 1, from the second - 2 and so on.
You can pass a certain data_id if you know what object you want to get, or pass DATA_ID_ALL to search through all these objects regardless of data_id.
There is also a corresponding method to retrieve this id from an object: get_object_data_id