I don't know what exactly is wrong with the sync of the server-side rotation of the object. The rotation is only synced for the netOwner of the object.
import * as alt from 'alt-server';
alt.on('playerConnect', handlePlayerConnect);
function degreesToRadians(degrees: number): number {
// Normalize degrees within the range [0, 360)
degrees = (degrees % 360 + 360) % 360;
// Convert degrees to radians
let radians = degrees * (Math.PI / 180);
// Convert radians to the range [-π, π)
if (radians > Math.PI) {
radians -= 2 * Math.PI;
}
return radians;
}
function getRandomInt(min: number, max: number) {
return Math.floor(Math.random() * (max - min + 1)) + min;
};
function handlePlayerConnect(player: alt.Player) {
player.model = 'mp_m_freemode_01'
player.spawn(38.19486618041992, 859.3850708007812, 197.71343994140625, 0);
}
setTimeout(() => {
let slotHeading = -1.8915420770645142;
let a = new alt.Object('vw_prop_casino_slot_02a_reels', new alt.Vector3(36.19486618041992, 859.3850708007812, 197.71343994140625), new alt.Vector3(0, 0, slotHeading));
a.collision =true;
a.visible = true;
alt.log(a.rot)
a.frozen = true;
alt.setTimeout(async () => {
let tempRot1 = a.rot;
let tempRot2 = a.rot;
let tempRot3 = a.rot;
alt.log(tempRot1.z);
for (let i = 1; i <= 300; i++) {
if (i < 180) {
let rand = 0 + degreesToRadians(getRandomInt(0, 360))
a.rot = new alt.Vector3(rand, tempRot1.y, tempRot1.z);
};
await alt.Utils.wait(10);
};
alt.log(a.rot);
}, 5000)
}, 10000);
Expected behaviour
The rotation should be synced.
Additional context
No response
Operating system
Windows
Version
release & latest dev (16.0.0-dev.283)
Crashdump ID
No response
Confirmation of issue's presence
[X] By submitting this ticket, I affirm that I have verified the presence of this issue on the latest developer version available at the time of writing this ticket.
Description of the problem
I don't know what exactly is wrong with the sync of the server-side rotation of the object. The rotation is only synced for the netOwner of the object.
https://streamable.com/ur0y69 https://streamable.com/ug1nuk
Reproduction steps
Expected behaviour
The rotation should be synced.
Additional context
No response
Operating system
Windows
Version
release & latest dev (16.0.0-dev.283)
Crashdump ID
No response
Confirmation of issue's presence