editor icon indicating copy to clipboard operation
editor copied to clipboard

Template's position doesn't change after clicking "Apply"

Open devcem opened this issue 2 years ago • 7 comments

Very simple bug, It basically doesn't update template json file for position and properties like this.

  1. Create template
  2. Change position
  3. Click apply
  4. Instantiate template on scene, it will still show up in old position

Video : https://streamable.com/vqwntq Project link : https://playcanvas.com/project/901528/overview/template-bug

Only fix I found is, delete the template and re-create it again.

devcem avatar Mar 23 '22 19:03 devcem

Is this on the root entity on the template? If so, it 'as designed' where the name and position to not change.

Arguably, the transform should reset when the template is created or inversely be save-able as you've described.

@zachpeterpaul thoughts?

yaustar avatar Mar 23 '22 22:03 yaustar

It's on root entity, although it keeps it's first position when template created, but I wanna change it, so it's not possible? I think this is so confusing, whether it's "as designed" or not.

In order to reset it I had to delete template and create it again. And figuring out that there was a bug on it, took my 1h.

devcem avatar Mar 24 '22 09:03 devcem

Not disagreeing that it isn't confusing 😅

The original idea was that the use case of templates was to put a number of instances around the scene at different transformations so saving having these properties show up as changes didn't make sense at the time.

I have a similar problem here with the name of the entity https://github.com/playcanvas/editor/issues/713

yaustar avatar Mar 24 '22 09:03 yaustar

Problem is, that if you have multiple instances of that template in Editor, and you position them around in different places, then applying a template, it will update all other instances, which will lead them to teleport to the same position.

Maksims avatar Mar 24 '22 10:03 Maksims

This has been brought up again in this thread: https://forum.playcanvas.com/t/templates-cant-apply-position-rotation/15273/12?u=yaustar

yaustar avatar May 04 '22 11:05 yaustar

I do think we need to make the transform and name (see https://github.com/playcanvas/editor/issues/713) to be properties that can be applied back to the template asset as options or be able to edit these directly at the asset level in the inspector.

@zachpeterpaul , do you have any thoughts on this?

yaustar avatar May 04 '22 11:05 yaustar

Just ran into this today. I had thought that the original position was just not saved tot he template to begin with, and was surprised to find it once I started instantiating in the editor.

A way to set the values at the asset level manually, or at least be able to reset to zero would be super helpful. That or not include the position settings at all in the template asset so that they would always be instantiated at 0, 0, 0 locally would be a lot less confusing.

eproasim avatar Oct 20 '22 19:10 eproasim