Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

a button with onPointerUpObservable need to be pressed two times #76

@assiomatica

Description

@assiomatica

Describe the bug
I have a button:

var button1 = GUI.Button.CreateSimpleButton("but1", "Top");
button1.width = "150px";
button1.height = "40px";
button1.color = "white";
button1.cornerRadius = 20;
button1.background = "green";
button1.top = "10px";
button1.verticalAlignment = 'top';
button1.onPointerUpObservable.add(function () {
console.log("up");
// _this.flyToHome();
_this.camera.restoreState();
_this.camera.update();
});

  advancedTexture.addControl(button1);

the button must reset the camera position but if I need to press for some seconds to see the camera reset.
seems the action (restore the camera) it's interrupted and cannot be completed the first click

Minimally Reproducible Example

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. See error in (location [e.g. JavaScript Console])

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots (optional)
Add any screenshots to help explain your problem, unless the minimally reproducible example is sufficient.

Environment (please complete the following information):

  • Device: [e.g. Desktop or Smartphone]
  • OS: [e.g. Windows]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions