4ian / GDevelop

🎮 Open-source, cross-platform 2D/3D/multiplayer game engine designed for everyone.
https://gdevelop.io
Other
11.27k stars 871 forks source link

3d Object Z(Elevation) position does not update to Preview when assigning 0(Zero) in the event editor. #5684

Open VanCastar opened 1 year ago

VanCastar commented 1 year ago

Is there an existing issue for this?

Describe the bug

When you have a preview open and change the elevation of a 3d object and update, the elevation does not change in the preview if the elevation is set to zero.

Steps to reproduce

Make a 3d object Place it on a project. Set it's elevation to something else but 0 (Like 20). Preview the game. Change the elevation of the object in event editor. Update the game preview. The preview object does not go to zero.

Note: The elevations update works on all other elevations BUT the zero.

GDevelop platform

Desktop

GDevelop version

5.2.172

Platform info

Windows 11 Pro

Additional context

This is the car floating at 20 Elevation. image

This is the car set to 0 elevation and updated. The car is still at 20 elevation instead of 0 that is set. image

Note: The update works on all other Elevations BUT the zero.

AlexandreSi commented 1 year ago

Hi @VanCastar, thanks for reporting this bug!

This is due to: https://github.com/4ian/GDevelop/blob/master/Core/GDCore/Project/InitialInstance.cpp#L111

This check was added to avoid writing "z": 0 in every instance (even the 2D ones) thus making the project file heavy.

I guess it will also happen for Rotation X and Rotation Y. I think there is something to do so that the 3D capability stores the Z to fix that. We'll have a look.