Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Moving ship towards mouse click not working well in the “boundary deadzone”?  (Read 734 times)

0 Members and 1 Guest are viewing this topic.

GCGsauce

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
http://pastebin.com/JM1ckbKt

The problem is that clicking on a new target position or dragging the mouse while the spaceship is in motion will cause the ship to follow the cursor, but I am trying to do 1 click, spaceship flies there and cannot redirect before it reaches the target. I tried to achieve this by not letting it change the target position with the flag (!m_moving) while flying and I tested this by debugging it and it seems the target is not changing which is great which is why im confused as to why it lets me do this. I've disabled repeated key presses for the windows.

The second problem is the boundaries, sometimes it works correctly but often it won't, the spaceship will fly through at times. I've printed out targetposition vs the distancetotravel, and it showed it working for a while and then eventually (the targetposition starts increasing when it should be gradually decreasing before it satisfies the condition that targetposition
« Last Edit: October 06, 2016, 09:09:50 am by GCGsauce »

GCGsauce

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email




This shows the targetdistance > distancetotravel when it goes towards the boundary, as you can see it bugs out at one point, and I can't think why because it works fine if its not against the boundary.

 

anything