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

Inherited Scene does not recognize that it's parent has a script #50759

Closed
apaza610 opened this issue Jul 23, 2021 · 3 comments
Closed

Inherited Scene does not recognize that it's parent has a script #50759

apaza610 opened this issue Jul 23, 2021 · 3 comments

Comments

@apaza610
Copy link

apaza610 commented Jul 23, 2021

Godot version

3.3.stable

System information

Windows 10, Nvidia GTX970

Issue description

I'm creating a piano game, therefore I thought about creating 1 base scene for 1 piano "Key"(parent) and 2 children keys "KeyWhite" & "KeyBlack" (as inherited scenes), I also BUILD THE LEVEL Map (piano with 24 keys), ONLY AFTER THAT I created a script for the "Key"(parent) but I noticed 2 situations in the instanciated child keys:

  1. They DO NOT recognize that the parent has a script !!!
  2. but creating new Instanciations, they DO recognize the parent's script (no problem at all).

Since I can't find a way to Force Refresh the OLD instances in the Level, I ended up REBUILDing THE ENTIRE LEVEL ....
otherwise I would need to write the scripts BEFORE the creation of the Level

Steps to reproduce

1- create scene "Map1"
2- create scene "Key" (parent scene)
3- create inherited scene "KeyWhite"
4- create inherited scene "KeyBlack"
5- create instance of "KeyWhite" inside "Map1"
6- create a SCRIPT attached to "Key" (parent)
7- create instance of "KeyBlack" inside "Map1"
8- here is the problem: "KeyWhite" does NOT have the script attached, conversely "KeyBlack" HAS it, a way to force update is needed here
TheProblem

Minimal reproduction project

Piano03.zip

@foxydevloper
Copy link
Contributor

foxydevloper commented Jul 23, 2021

The problem seems to be that property changes don't propagate through more than 1 level of inheritance.
If you have: Node C inherits from Node B inherits from Node A, changing a property inside of Node A will only update the new property for Node B, not for Node C. Example:

2021-07-22_22-22-28.mp4

EDIT: This only happens if you have C open while editting A, otherwise it works fine.

When you changed Key's script, it only updated the new script for KeyBlack and KeyWhite's scenes, it didn't update for the instances of KeyBlack and KeyWhite.

You can fix this manually by reverting the script property for the instances of KeyBlack and KeyWhite:
2021-07-22_22-31-04

This issue occurs in v4.0.dev.custom_build [5156703] as well.

@foxydevloper
Copy link
Contributor

Related to: #7984

@apaza610
Copy link
Author

Thanks @foxydevloper, that indeed solves the problem...

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

4 participants