Differences between viewport and stanalone

Hi, I am developing a project in which there are a few objects orbitating on others.
For this I am using AddLocal Offset and set world rotation, In the viewport everything is working fine, but when I package the project or play in standalone the rotation appied to the object is wrong and it is orbitating on the wrong object.
The object in which others are orbitating is defined using the index.
I need to solve this problem today because tomorrow I have to show the project to some people.
(Edit)
It turned out to be an indexing problem, objects are indexed differently in viewport and standalone, how can I prevent that from happening or forecast the indexes in standalone and in the viewport ?