LeahElanaa
9 months agoMember
Does the Focus Prompt option for CustomUI enter FocusedInteraction?
If a player clicks the focus prompt button that is built in with customUI, do they enter FocusedInteraction? Meaning could I use the CodeBlockEvent OnPlayerEnteredFocusedInteraction? Right now my assumption is no because it is not working for me, but I wanted to check in case my code is the problem.
preStart() {
this.connectCodeBlockEvent(this.entity, CodeBlockEvents.OnPlayerEnteredFocusedInteraction, this.onFocusedInteraction.bind(this));
}
start() {}
initializeUI() {
return View({
});
}
onFocusedInteraction(player: Player) {
console.log("onFocusedInteraction triggered");
if (this.entity) {
player.focusUI(this.entity, {
fillPercentage: 0.4,
});
console.log("UI focused successfully");
} else {
console.error("Entity is null or undefined");
}
}
That is correct. The focused interaction events (enter/exit) are not broadcasted when interacting with CUIs