A few questions relating to Y rotation
Posted: Fri Dec 17, 2021 7:30 am
Hi,
I've started working on a new Z game, using a newer build of Z game editor, which is version 4.0b (previously I was using version 1.9).
Anyhow some code that I was using in the older version is running differently now, and I'm wondering why this is and how I can fix it.
So specifically it is setting the direction of flat 3d objects to always face towards the camera.
The code that I previously used was, on update : CurrentModel.rotation.y=AppCameraRotation.y/-1;
This code still works fine, but when used in conjunction with the code (used on the model spawn event) Currentmodel.rotation.z=random(1,1);
It ends up rotating objects seemingly on the x axis. In previous versions it never behaved like this and visually it looks wrong.
Any ideas whats going on here?
Additionally I've noticed, having converted one of my older projects into the newer build of Z game editor, all of the sound effects (previously saved in raw format) are garbled, thankfully I see that it is now possible to use the .ogg sound format. So I've converted a few of the samples into .ogg and loaded them into the game. Initially this seemed to be working fine but after loading the 3rd sample into the game, and having it play at a certain instance, I notice that the entire global volume goes to zero, effectively silencing all sounds in the game for a few seconds, every time the game attempts to play the sample. I'm also curious as to what might be causing this?
Anyhow, any thoughts feedback or suggestions on these 2 questions would be most welcome!!
I've started working on a new Z game, using a newer build of Z game editor, which is version 4.0b (previously I was using version 1.9).
Anyhow some code that I was using in the older version is running differently now, and I'm wondering why this is and how I can fix it.
So specifically it is setting the direction of flat 3d objects to always face towards the camera.
The code that I previously used was, on update : CurrentModel.rotation.y=AppCameraRotation.y/-1;
This code still works fine, but when used in conjunction with the code (used on the model spawn event) Currentmodel.rotation.z=random(1,1);
It ends up rotating objects seemingly on the x axis. In previous versions it never behaved like this and visually it looks wrong.
Any ideas whats going on here?
Additionally I've noticed, having converted one of my older projects into the newer build of Z game editor, all of the sound effects (previously saved in raw format) are garbled, thankfully I see that it is now possible to use the .ogg sound format. So I've converted a few of the samples into .ogg and loaded them into the game. Initially this seemed to be working fine but after loading the 3rd sample into the game, and having it play at a certain instance, I notice that the entire global volume goes to zero, effectively silencing all sounds in the game for a few seconds, every time the game attempts to play the sample. I'm also curious as to what might be causing this?
Anyhow, any thoughts feedback or suggestions on these 2 questions would be most welcome!!