GameManager.prototype.enterStartState = function () {
console.log(“We are in the Start State”);
//Show many things in one then
return Promise.resolve()
.then(() => {
// Play the baby animation and wait for 1500 milliseconds
const doctorPromise = doctor.enabled = true;
this.subtitleTextMain.enabled = true;
const delayPromise = new Promise(resolve => setTimeout(resolve, 1000));
// Race between the baby animation and the delay
return Promise.race([doctorPromise, delayPromise])
.then(() => {
// Play the mother animation after the delay
return this.playAudioWithAnimationPromise(doctor, 'Talk1', 'Doc_Aud_1', doctorDialogue[0]);
});
})
.then(() => this.tablePointer.enabled = true)
.then(() => this.waitForPlayerToHitTable('playerHitTable'))
.then(() => this.tablePointer.enabled = false)
.then(() => this.which_grabHints(2))
.then(() => {
// Start executing these lines concurrently with the 2500ms delay
const buttonPromise = this.which_Button(0);
const waitForButtonPromise = this.waitForButtonClicked('isGetStartedButton_Clicked');
return Promise.all([
new Promise(resolve => setTimeout(resolve, 4500)),
buttonPromise,
waitForButtonPromise,
]);
})
.then(() => this.full_GrabHints(false))
.then(() => this.bedwithPillowFULL(false))
.then(() => this.theEntityHolder.bedWithoutPillow.enabled = true)
.then(() => {
this.htmlcssLoaderScript.fadehtml.style.display = "block";
return new Promise(resolve => setTimeout(resolve, 2000));
})
.then(() => this.htmlcssLoaderScript.fadehtml.style.display = "none")
.then(() => this.charactersLoad())
.then(() => this.crosshairLoaderScript.screens[0].enabled = false)
.then(() => this.which_Button(1))
.then(() => this.changeState(GameState.AnimState))
.catch((error) => {
console.error('Error:', error);
});
};
I get this error after this line:
return this.playAudioWithAnimationPromise(doctor, ‘Talk1’, ‘Doc_Aud_1’, doctorDialogue[0]);
Actually this game is made for FPS controls for PC with the same code which works so perfect
I am making a VR version. but the same gameplay flow is crashing with this error
ASSERT FAILED:
Invalid batch 100000 insertion
ASSERT FAILED:
Invalid batch 100000 insertion
Please help me fix it
I tried all possible ways from my side
Please suggest me the correct and working code without this error