Game, user writes solutions if content correct goes to scene

Getting started on JS and made this adapting some tutorials and templates. I'm sure it has tons of errors... I have a form field where the user writes a word, and if it's correct, it goes to a Scene. So I did:

function confirmar(hypeDocument, element, event) {

	if ( $('#nameForm').val() == "Test" ) {
		hypeDocument.showSceneNamed('backlog', hypeDocument.kSceneTransitionPushRightToLeft, 1.1);
	} else {
		hypeDocument.showSceneNamed('restart', hypeDocument.kSceneTransitionPushRightToLeft, 1.1);
	}
	
}

Any ideas?
respuesta-correcta.hype.zip (61.4 KB)

Hola Juan!

There are two "nameForm" IDs being used in your example - one in the innerHTML of the form and the other in the "Unique Element ID" in the "Identity Inspector".

Removing "nameForm" from the "Unique Element ID" field in the "Identity Inspector" had things worked as intended > went to the "backlog" scene when entering "Test" into the form field.

1 Like

Thank you!

1 Like