So we are making a game for our final project in our school in VR. The concept is: 1:1000 scale change of player and time.
I am scaling up to environment to make the player ‘tiny’.
For 1 → 1000, I do SetActorScale3D(GetActorScale3D()* 1000.0f); and this will do the job
HOWEVER, when wanting to scale back to the original size (mostly 1000 → 1 for most objects)
If I use this
SetActorScale3D(GetActorScale3D() / 1000.0f);
Things completely get screwed. Infinite / Zero masses, incorrect bounds, 300 ms gameplay time due to collision, and 0,0,0 scale!!! Even though I scaled 3000 to 3 using a division by 1000, it shows 0 on all axis on ALL OF THE scaled items!!!
However, interesting enough… I decided to store the objects’ initial scale in BeginPlay by storing the startingScale in the header file.
StartingScale = GetActorScale3D();
And then for scaling (since it is not continouous, I can just do this), I just do StartingScale * 1000 for becoming big, and StartingScale for becoming normal size again.
THIS WORKS COMPLETELY FINE!!! How is this even possible?!
I assume it has to do with NaN checks or Getting the SafeScale or something. I don’t know. Would appreciate the help! My issue is fixed but in general, it took me a while to realize it is an engine issue and not my thing.