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

Setting the global rotation of a Node3D does not retain its scale #74162

Closed
fatduckling opened this issue Mar 1, 2023 · 0 comments · Fixed by #90584
Closed

Setting the global rotation of a Node3D does not retain its scale #74162

fatduckling opened this issue Mar 1, 2023 · 0 comments · Fixed by #90584

Comments

@fatduckling
Copy link

Godot version

v4.0.rc1.official [8843d9a]

System information

Ubuntu

Issue description

Hi,
I'm using GDExtension C++ to change a Node3D's global rotation. I've noticed that if you do something like this:

    godot::Node3D* m_localPlayer = ...;
    godot::Vector3 scale = m_localPlayer->get_scale(); // (0.05, 0.05, 0.05)
    m_localPlayer->set_global_rotation(godot::Vector3(0,0,0)); // change the rotation
    scale = m_localPlayer->get_scale(); // scale reset to (1, 1, 1)
    // I have to manually add this to reset the scale to its original position
    m_localPlayer->set_scale(godot::Vector3(0.05f, 0.05f, 0.05f)); 

This can also be reproduceable in GDScript:

extends Node3D

# Called when the node enters the scene tree for the first time.
func _ready():
	$Adventurer.set_scale(Vector3(0.5, 0.5, 0.5)); 
	print("Current scale: ", $Adventurer.get_scale());
	$Adventurer.set_global_rotation(Vector3(0,35 * (3.1415/180),0));
	print("New scale: ", $Adventurer.get_scale()); // (1, 1, 1)

After I do set_global_rotation, I noticed it changed the scale from (0.05, 0.05, 0.05) to (1, 1, 1). Is this a bug or expected behavior.

Thanks

Steps to reproduce

Simply run the reproducible project to see the last print statement shows that the scale is reset back to (1,1,1).

Minimal reproduction project

bug.zip

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

Successfully merging a pull request may close this issue.

4 participants