Templates make everything easier, but it takes a while to fully understand how it works.
I was working on my Instruction template. I have a couple of entities from that tempIate with an override name, like the entity below. I disabled the Area entity from it and in the scene I changed the position of the Button.
I applied the changes with right click on Position and choose apply to “MoveInstruction”. (I think this option name should be “Instruction” since this option will apply the change to all other entities from the same Instruction template and not only this MoveInstruction entity).
The position change of the Button entity is only changed in the entity where I did the change. For example the red template has the orginal position because I didn’t make a change from that entity.
Offcourse I refreshed the pages but the results stay the same.
Just before I want post this topic, I discover what the problem is. I don’t know if it is a bug or not, but when you change the position of the entity, the Margin of the element is also changing. When applying this change too, everything is okay again.
That sounds like as designed. The margin changes with position or more accurately, the margin controls what the position of an element should be which would explain the issue you were seeing.
My template clones are apparently very stubborn. They no longer listen to changes at all. I have now managed to get everything right in the launch while everything is mixed up in the editor.
You are already in the project. I made you admin so I think you can create a new branch yourself or you can fork the project. (I have already made a checkpoint).
Can you confirm the checkpoint that has the issue please? There should be a short id in the commit message of checkpoint in the version control dialog.
I reviewed the project, templates seem to work as expected. Please note that a UI entity may have Element (and related to it ‘position’) overrides that cannot be “applied” for UI implementation-related reasons, @vaios can explain more. Please maybe add him to your project as well, he is a member of our team. You may also find our version control (checkpoints and branches) useful: https://developer.playcanvas.com/en/user-manual/version-control/
Some values related to UI elements are not supposed to be saved in template assets (they are relevant for template instances only). What is saved in the database for that instance seems to be correct (because the database values are used at run time). @vaios would probably have to check why it looks different in the editor.
I have created a template from an existing entity. This is the first entity on the image. I want to make from all other entities on the image also a template of this new template. Is there a way to do this or do I have to remove all entities and reimporting these as a template? For now this is not problem, but if you have a big scene it could be.
Hi @eproasim! I think you misunderstand my question, or I misunderstand your answer. I want to turn entities that are no template into an existing template.
Sorry for the confusion. I should have opened a new topic for this. The first part of this topic is still waiting on bug fixes in the template system I guess.
I have a couple of entities in my scene that I want turn into one template. I can turn one entity into a template, but how to do this for all of them? If I do it one by one I get a lot of same templates, which is not the intention. (The result should be a couple of entities that are the same template).