-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Implicit conversion of Quat to Basis not raising error. Assignment works in debug, in release does nothing. #57099
Comments
As pointed out on Twitter, this might be related to #48090 (and #48999). |
Tested with a |
This one was quite tricky to understand what was happening. It boils down to some type information not available on release builds, which is used to detect if a conversion is needed. GDScript rely on the information from the return type of the getter for the property ( There are a few potential solutions for this.
|
I just noticed this was done in |
The commit has a lot of conflicts when cherry-picked to |
This was solved by #59793. |
Godot version
3.4.2
System information
Kubuntu 18
Issue description
If you assign a Quat to Basis the editor will not flag this is an error and allow compilation. At runtime this will be implicitly converted from Quat to Basis, but it should require a cast.
Editor is fine with this:
global_transform.basis = current_rotation.slerp(m_target_rotation, m_weight)
It should raise an error unless it is stated as follows:
global_transform.basis = Basis(current_rotation.slerp(m_target_rotation, m_weight))
Run from the editor and debug builds there will be no issues. In release builds the rotation will simply not happen. No error or crash, just silent failure to do the slerp.
Steps to reproduce
The only script code is that stated below attached to a MeshInstance with a cube mesh, of course add a camera to the scene to see what the cube is doing.
If run as is in debug there will be no issue and the cube will rotate. If you export as release build and run, the cube will not rotate.
Then uncomment the commented line and comment out the last line and export (so now explicitly create the Basis from a Quat). The cube will now correctly rotate in a release build.
Minimal reproduction project
BasisQuatBug.zip
The text was updated successfully, but these errors were encountered: