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

Inconsistent script switching #88640

Closed
mubinulhaque opened this issue Feb 21, 2024 · 2 comments
Closed

Inconsistent script switching #88640

mubinulhaque opened this issue Feb 21, 2024 · 2 comments

Comments

@mubinulhaque
Copy link

Tested versions

Tested in v4.2.1

System information

Windows 10.0.19045 - Vulkan (Mobile) - dedicated NVIDIA GeForce GTX 1650 SUPER (NVIDIA; 31.0.15.5152) - Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (8 Threads)

Issue description

Selecting a scene should ideally also select the script that was last selected in that scene. Instead, a script is randomly selected from the ones currently open, with no indication as to how this script was selected.

Steps to reproduce

  1. Open multiple scenes
  2. Open multiple scripts
  3. In each scene, open a different script
  4. Switch between scenes
  5. Notice how switching between scenes selects a random script each time

This is noted in the video below:

2024-02-21.17-44-42.mp4

Minimal reproduction project (MRP)

N/A - any project with multiple scenes and scripts can reproduce this issue

@Cammymoop
Copy link
Contributor

It doesn't pick a random script. When you switch scene tabs, the script attached to the scene root is chosen, and if there isn't one it will search the scene tree for a node with a script attached (this appears to be depth first) and that script is switched to. It also opens that script if it wasn't already opened.

If you want to suggest improving the current functionality please open a proposal here https://github.com/godotengine/godot-proposals/issues

@Calinou
Copy link
Member

Calinou commented Feb 21, 2024

Thanks for the report! Consolidating in godotengine/godot-proposals#8372.

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