Jump to content

Mesh "jump" when mous clicked, Bug ?


nodejs
 Share

Recommended Posts

Hello, 

i created a litle game, based on the car demo in the playground,
Now i have noticed that when i click with the mouse (left, middle, right) the car bounce a litle for and then back. also when the key is released.

I have created an video: https://sendvid.com/f3xjn5vd
Have a look on the console.

I dont think this is not an problem with my game logic, more with the canvas.
Like you drag & drop the frame.

Has anyone an similar problem or a fix for me ?
I dont know what to do.

 

Link to comment
Share on other sites

Hiya NodeJS, welcome to the forum.  Umm... can you make this problem happen... with the playground version?

Or, can you show us your keypress handler and click handler code, if some is active?

Is ANY code executed when user presses key or clicks mouse buttons?  If so, look VERY carefully at that code.

It LOOKS like car only jumps forward/backward.  This might indicate that something is setting car position to car current position.  There SHOULD be no-affect, but...

... when the car gets its .position set, it has already traveled forward a small amount.  When the position is set, the car jumps backwards to the location where the .position was "sampled" (gotten-from).  That is an "old" or "stale" position, and this makes the car jump backwards a small amount.

If you ARE setting a .position or doing a .moveWithCollisions(someAmount) INSIDE-OF your keypress or click handlers... turn that off.  Test again.

I think this is the area of trouble.  Positioning or moving the car to a stale/old position.  The car WAS at that location, but exited that location 1/4 second ago.  :)

Link to comment
Share on other sites

Copyd the source from the playground, and the "bug" is still present.
I dont have any click handlers or key input, expect the Babylon ActionManager();

I commited everything else out what can handle user inputs.
 

EDIT: reduced evrything to an minimal HTML markup & script from playground: Bug still exists

EDIT2: As i want to upload my game for debugging, i added the Babylon.js 2.5.0 from CDN.com -> bug is gone. If you use 3.0.1 Beta the bug is there

Game in the Attachment for Demo.
Feel free to change the Babylon.js versions,  from 2.5.0 to 3.0.1 or backwards. Then you see there is a bug when you click with your cursor on the canvas

index.html

Link to comment
Share on other sites

H again, NJS.  We're kind-of waiting for the big dogs to return from weekend break.  This one has me baffled/stumped, so far.

I have done home testing, and I see the issue (and agree about BJS versions). 

I see no problems with keypresses, so far.  I DO see "car jump" with mouse-down and mouse-up. 

Camera pointer inputs are not involved, because camera is not attached to canvas.

scene.onPointerDown is not the problem (I don't think), because I over-rode it, and removed ALL code from that function.  The issue still persisted.

Tested mostly in Firefox.  With IE, I had to "fight" to get it to load, but it finally did.  Same problems seen.

We're watching this issue closely, and we will determine WHY this is happening, hopefully soon.  *scratch scratch*

Thx for the report! 

Link to comment
Share on other sites

Hi R.  I couldn't make it happen in PG, either.  Use the provided index.html (in 3rd post) to see the issue, if you please. 

Car must be moving.... for click-jump to happen.

On 11/11/2017 at 10:54 AM, nodejs said:

Copyd the source from the playground, and the "bug" is still present.

I used some "read between the lines", there.  :)  NodeJS copied a PG version that showed no problems.  When NodeJS got it home, and switched BJS to CDN version, the problem started.

See top section of his/her index.html:

    <!-- NO BUG !!!! -->
    <!--<script src="https://cdnjs.cloudflare.com/ajax/libs/babylonjs/2.5.0/babylon.js"></script>-->

    <!-- BUG: Bouncing car -->
    <script src="http://cdnjs.cloudflare.com/ajax/libs/babylonjs/3.0.1-beta/babylon.js"></script>

I'm not sure if the playground can be told to use CDN versions.  If not, PG is useless for this bug-find.

Link to comment
Share on other sites

:)

Patient:  Doctor, doctor, it hurts when I do this!  (some physical action)

Doctor:  Well don't DO that! 

heh.

Yeah, the plausibility of "fixing" this, or losing sleep over it... might not be there.  Still, it's great when users report these issues... so we know things.

Link to comment
Share on other sites

Nice one! :) 

I think that it is not the case here, as we already have a stable version to this beta... It is more along the line of:

Patient: Doctor, the old pills you gave me are not working!

Doctor: But I already prescribed new pills a few months ago, why don't you use them?

 

Not as funny, but a bit more accurate ;)

 

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...