Jump to content

velocityFromAngle cause inaccurate movement


Recommended Posts

Hello, when I call velocityFromAngle this way:

scene.physics.velocityFromAngle(this.angle+this.imgAngle, this.speed, this.body.velocity);

It actually push my image in “inaccurate” way. As you can see in picture, on calling velocityFromAngle I create line, to see where my object shoult end. But it goes little bit out of line, so it end little bit up/down. Why?
If I exclude “this.body.velocity” from method calling, and instead I call this:

Everything works fine…Why is setting velocity in velocityFromAngle inaccurate (it gives me same result if I pass there this.body.acceleration).

Another strange thing is, that how much it goes out of line depends on passed speed. If it is 500, it gives results as shown in pictures. If it is 100, image ends only little bit above line. If it is 30, it ends in right position (on line).




Link to comment
Share on other sites


  • Recently Browsing   0 members

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