Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Why physics engine summate the direction of the vectors?
Started by stalxerhd Jan 13 2020 11:51 PM

No replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

stalxerhd

[GLOBAL: userInfoPane.html]
stalxerhd
  • Observer

  • 23 posts
  • Corona SDK

In my game, the physics engine is periodically paused/started via commands physics.start() and physics.pause().
 
When the game works, there are no big problems with the direction of the object; in 99% it always moves to the point, pressed on the screen. The same be, if at the time of a pause press once on the requested point on the screen.
 
But, if I make several clicks on pause...
 
for example, the first tap on position #1 and after 1-2 seconds more accurate second tap on position #2 - I had shown it on a figure
 
...after continuing the physics engine will send the object to the resulting vector of tap1 and tap 2, instead of just sending an object to position 2.
 
When tap happens, I always reset the current state of the object via setLinearVelocity00), so, when the second tap happens, it should forget first.
 
Did I do smth wrong or how to set physics engine process only the latest callout, when it paused?
 
P.S. the object has a dynamic physical type.
 
Attached File  1.png   6.08KB   0 downloads



[topic_controls]
[/topic_controls]