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

fix for #2311 #2316

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

fix for #2311 #2316

wants to merge 14 commits into from

Conversation

cNori
Copy link
Contributor

@cNori cNori commented Mar 10, 2024

replaced ASSERT with Platform::CheckFailed for now, the #2311 can be moved to 1.9

added a check and a massage
image
ps.
there is not real way to fix it in the sake what state is should be selected

@cNori cNori changed the title Hacy fix for https://github.com/FlaxEngine/FlaxEngine/issues/2311 Hacy fix for #2311 Mar 10, 2024
@cNori cNori marked this pull request as draft March 11, 2024 13:52
@cNori cNori marked this pull request as ready for review March 11, 2024 15:25
@cNori cNori changed the title Hacy fix for #2311 fix for #2311 Mar 11, 2024
Copy link
Contributor

@Menotdan Menotdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider changing the message to be something like:

"Disabling the enabled state of an object in OnStart() is not supported.\n"
"OnStart() is called just before OnEnabled(), which expects the enabled state to be true.\n"
"See:\n"
"https://docs.flaxengine.com/manual/scripting/events.html?tabs=code-csharp\n"
"If you want to force the object to be disabled when the game is started, consider using OnAwake()."

@cNori cNori marked this pull request as draft March 11, 2024 21:39
@cNori
Copy link
Contributor Author

cNori commented Mar 11, 2024

i think now it is stable

@Menotdan
Copy link
Contributor

"Modification of the Enabled state failed, state was modified before the object got a chance to call Enable().\n"
"This may cause unexpected behavior in your scripts.\n"
"See:\n"
"https://docs.flaxengine.com/manual/scripting/events.html?tabs=code-csharp\n"
"Note:\n"
"If you were trying to disable the object when the game starts, consider using OnAwake()."

Maybe a better message now? I tried to modify it less and keep the language more readable.

@cNori
Copy link
Contributor Author

cNori commented Mar 12, 2024

"Modification of the Enabled state failed, state was modified before the object got a chance to call Enable().\n"
"This may cause unexpected behavior in your scripts.\n"
"See:\n"
"https://docs.flaxengine.com/manual/scripting/events.html?tabs=code-csharp\n"
"Note:\n"
"If you were trying to disable the object when the game starts, consider using OnAwake()."

Maybe a better message now? I tried to modify it less and keep the language more readable.

look ok

@cNori cNori marked this pull request as ready for review March 12, 2024 12:07
@cNori
Copy link
Contributor Author

cNori commented Mar 13, 2024

OnAwake triggered it also in rare cases

new massange

"Modification of the Enabled state failed, state was modified before the object got a chance to complete Enable() call.\n"
"Note:\n"
"Try to not modify the enabled state in OnStart or OnAwake, if object is disabled when is spawned. this might interupt Initialization code\n"
"also this may cause unexpected behavior in your scripts."

@mafiesto4 mafiesto4 added the level Level building tools and components. label Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level Level building tools and components.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants