Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default instance inconsistent between run and edit time #8352

Open
F3der1co opened this issue Dec 9, 2024 · 4 comments
Open

default instance inconsistent between run and edit time #8352

F3der1co opened this issue Dec 9, 2024 · 4 comments
Assignees

Comments

@F3der1co
Copy link

F3der1co commented Dec 9, 2024

Problem description

The default instance is different between edit and runtime. These should be unified to be less confusing. Also the way the default instance is selected at runtime is better as it gives us more control (being the first instance on the first layout in layout order defined by the project bar).

Attach a .c3p

defaultInstance.zip

Steps to reproduce

  1. drag a new tilemap instance into the layout from the project bar
  2. note which tilemap it was spawned with
  3. run "layoutToTest"
  4. see which tilemap was spawned

Observed result

default instances are different between edit and runtime

Expected result

the default instance is the same (runtime default instance is the expected one for both cases)

More details

Affected browsers/platforms:

First affected release:

System details

View details

PASTE HERE

@F3der1co F3der1co changed the title creating instance at edit time picks wrong default instance default instance inconsistent between run and edit time Dec 9, 2024
@Jase0000
Copy link

Jase0000 commented Dec 10, 2024

I know this has been a long-time issue, but now we have templates, perhaps we could have option for objects to define a "default template", so whenever an object is dragged onto a layout, or created at runtime with blank "template" param, it can pull from the chosen "default template", thus solving this once and for all? This wouldn't affect old projects since older projects haven't defined the default template, and solves it for anyone that wishes to choose a default.

Still means we must setup a template to define a default, but that's absolutely fine to do imo!

EDIT: I guess theres issues with this idea, such as changing the default template and what it should do to all objects already in a layout, but yeah just spitballing ideas.

@AshleyScirra
Copy link
Member

If I drag the tilemap in from the Project Bar in r419, it creates a tilemap with a number 3 drawn on it. If I preview 'layoutToTest', it looks like it creates an instance of a tilemap with a number 3 drawn on it. So it looks like it is consistent to me. Note your "observed result" doesn't actually describe what you see, only that it's different. Am I missing something?

@F3der1co
Copy link
Author

interesting, I also cannot reproduce this anymore. Maybe there is something tied to the current session. But Tokinsom on the suggestion referenced above described the same issue, so I am certain this issue exists.
I'll investigate further

@F3der1co
Copy link
Author

F3der1co commented Dec 10, 2024

@AshleyScirra ok, so I can reproduce the issue when I make a new project, but if I save, close c3, open the project again it works as expected.
This makes creating a repro c3p difficult.

repro.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants