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

Camera.GetGlobalTransfrom() in C# returns a different value from Camera.get_global_transfrom() in GDScript. #18886

Closed
ioannis-koukourakis opened this issue May 15, 2018 · 4 comments
Labels

Comments

@ioannis-koukourakis
Copy link

ioannis-koukourakis commented May 15, 2018

Godot version:
Godot_v3.0.2-stable_mono_win64

OS/device including version:
Windows 7 & Windows 10

Issue description:
Camera.GetGlobalTransfrom.basis in C# returns a different value from Camera.get_global_transfrom() in GDScript.

Steps to reproduce:
It should be as simple as placing a Camera then log let's say the forward vector:
GD.Print(Camera1.GetGlobalTransform().basis.z); and print(Camera2.get_global_transform().basis.z) using C# and GDScript respectively. Shouldn't those two return the same results?

In my case the values are:
(-0.766044, 0271654, -0582563) for C# and
(0.694272, 0.422618, -0.582563) for GDScript.

If I had the required time I would test it with Spatial class too. I think the issue extends down to that.

Edit:
The same issue occurs with GetTransfrom() and GetCameraTransform().

@ioannis-koukourakis ioannis-koukourakis changed the title Camera.GetGlobalTransfrom.basis in C# returns a different value from Camera.get_global_transfrom() in GDScript. Camera.GetGlobalTransfrom() in C# returns a different value from Camera.get_global_transfrom() in GDScript. May 16, 2018
@DigitalMonkeyPa1
Copy link
Contributor

It seems like you are accessing different cameras:
in C# code you used Camera1, and in GDScript you used Camera2.
Are both Camera1 and Camera2 same, try accessing with a single camera reference in both languages.

@nazgulsenpai
Copy link

3D transforms are broken on 3.0.2 with C#. See my issue:
#17306
and
#16937

I'd recommend using the 3.0.3 RC2 release, as the transform issues have been corrected:
https://godotengine.org/article/dev-snapshot-godot-3-0-3-rc-2

@ioannis-koukourakis
Copy link
Author

ioannis-koukourakis commented May 17, 2018

@DigitalMonkeyPa1 I'm using a single camera node and simply switching scripts. I believe the problem is better highlighted in action: https://godotdevelopers.org/forum/discussion/19454/move-player-in-relation-to-camera-direction

@nazgulsenpai thanks for the info. I wish I knew about RC2 earlier cause I moved the entire project to GDScript. I think I'll stick with it at least until a stable mono version is out.

@ioannis-koukourakis
Copy link
Author

Closing because it has already been reported and fixed.

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

No branches or pull requests

4 participants