Pryme8 Posted March 8, 2018 Share Posted March 8, 2018 http://www.babylonjs-playground.com/#36TFT6#5 Just like the title says, I am getting double fires on the pointer up response. Quote Link to comment Share on other sites More sharing options...
pichou Posted March 8, 2018 Share Posted March 8, 2018 Yes, I noticed the same thing. Had to use a test to ignore the second trigger. Pryme8 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 8, 2018 Author Share Posted March 8, 2018 so like: var ignoreFlag = 0; ...onPointerUp... { if(ignoreFlag){return;} ignoreFlag = ignoreFlag?1:0; } or something like that? Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 9, 2018 Share Posted March 9, 2018 https://github.com/BabylonJS/Babylon.js/issues/3908 Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 9, 2018 Share Posted March 9, 2018 sorry, bug closed This is by design. the onpointerup is fired twoce - once for the TAP event and once for POINTERUP. you can check for type in your callback and react to only one of them. pichou and Pryme8 2 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 9, 2018 Author Share Posted March 9, 2018 Ah gotcha! Thank you sir. That clears things up. Shouldnt the types of the responses be pointerup and touch? @RaananW Both of the events I see are registering as pointerType:"mouse" http://www.babylonjs-playground.com/#36TFT6#12 Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 9, 2018 Share Posted March 9, 2018 The right way to go would be this - http://www.babylonjs-playground.com/#36TFT6#14 onPointerUp is amazingly useful, but technically deprecated. The type is not broadcasted there (thou I see no reason not to do it, honestly. I will add type later as a 3rd variable for people still using this function) Pryme8 and Wingnut 1 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 9, 2018 Author Share Posted March 9, 2018 well damn... I need to go over these observables. http://www.babylonjs-playground.com/#36TFT6#15 Now I have all the pointer events under that one observable. cool, thanks! Quote Link to comment Share on other sites More sharing options...
pichou Posted March 10, 2018 Share Posted March 10, 2018 Thanks @RaananW! Works perfectly with observables. So does it mean that we have to always use obvervables instead of onPointerUp/Down because they will not be maintained anymore? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 10, 2018 Author Share Posted March 10, 2018 They keep everything reverse compatible for the most part, so I assume the old methods will be left alone but in documents and tutorial the newer ones will be showcased. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 12, 2018 Share Posted March 12, 2018 It is always recommended to use observers, but we will keep things backwards compatible, so those onPointerUp callbacks will stay there. I actually added the "type" as a 3rd parameter to the onPointerUp callback in a recent pull request, so you can continue using the single callback. but again, observers are the future! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.