Set parent to another collection go

A, probably stupid, question.

I have a collection with name “collectionA” with a go object with name “go1”. This collection creates a collection via collectionfactory that creates another collection… and so on. In a script in one of the created objects I would like to set the parent of the object to go1 of collectionA. But I am NOT able to do this!

I tried:

local url = msg.url("collectionA", "go1", nil)
go.set_parent(".", url, false)

but it doesn’t works! I get

Could not find any instance with id "go1"

Any help? What am I doing wrong? (Tried also many other variation… also randomly at the end :slight_smile: )

Thanks!

EDIT: some of this collections created by collectionA are proxy collections… does this prevent to set the parent as I want?

Collection proxies create different worlds so maybe that’s why. I would make a minimal example with the different situations to test go.set_parent().

Of course factories may solve this issue, delete the go and create a new one attached to the other collection.

My aim is to have a unique global object where to attach all go’s which need to be “aligned” in a certain way…

I think it’s because of the first line. I don’t remember exactly and can’t check right now, but try instead of

local url = msg.url("collectionA", "go1", nil)

This:

local url = msg.url("collectionA:", "go1", nil)

or this

local url = msg.url("collectionA:", "/go1", nil)

@AGulev. Tried as you suggested, but “:” at the end of the collection name generates an error: “the socket name is invalid”…

Tried also “/go1”. No luck!