[Behavior] moveto

Post your completed addons to share with the community

Post » Sat Oct 14, 2017 10:28 am

Hi @rexrainbow

I'm facing a strange issue with the "MoveTo" behavior.
It says remaining distance 0, but it's still saying "moving"

Image
Image

The player is exactly in the position he has to be (that's why the remaining distance is 0).
However sometimes it's "-0.00053", then the "moving" boolean is set to wrong.
Could it be an issue that the "moving" boolean will not be toggled when the distance is exactly 0?

Thanks for your help!
Image Image iTunes: Match3 | Google Play: Match3
B
103
S
37
G
31
Posts: 1,164
Reputation: 28,928

Post » Sat Oct 14, 2017 2:10 pm

@AndreasR

Thanks, I had fixed the issue of negative of remain distance. Now it will be 0 when moved to target.
But I did not find the first bug -- It says remaining distance 0, but it's still saying "moving", please provide a very simple capx for this bug.
B
109
S
27
G
277
Posts: 4,482
Reputation: 154,924

Post » Sun Oct 15, 2017 6:39 am

rexrainbow wrote:@AndreasR

Thanks, I had fixed the issue of negative of remain distance. Now it will be 0 when moved to target.
But I did not find the first bug -- It says remaining distance 0, but it's still saying "moving", please provide a very simple capx for this bug.


Hi @rexrainbow

thanks for the quick fix. I figured out why the "is moving" boolean remains at true.
I made a simple capx, please find it here.

https://www.dropbox.com/s/9chra5d806k2w ... .capx?dl=1

It's caused if you let move the player to a position he already is. So the distance is actually 0 from the start, but if you call the event "Move to [current.X, current.y]"
the "is moving" boolean is true, but the player doesn't move actually, so it never gets set to false.
Image Image iTunes: Match3 | Google Play: Match3
B
103
S
37
G
31
Posts: 1,164
Reputation: 28,928

Post » Mon Oct 16, 2017 3:48 am

@AndreasR

1. In this tick, sprite hits target position, triggers that event, and try to move to (current) position,
2. In next tick, sprite moves 0 pixel (is moving is true) and the same as step 1, sprite hits target position, triggers event and try to move to (current) position.
3. repeat step 2, ...


is moving is always true in this case. It is correct.
B
109
S
27
G
277
Posts: 4,482
Reputation: 154,924

Post » Thu Nov 16, 2017 7:25 pm

I am trying to download the move to plugin here:
https://c2rexplugins.weebly.com/rex_moveto.html

It's 16kb but is empty

Cancel that. I installed 7z to extract it. :) Works now
B
6
S
1
G
2
Posts: 4
Reputation: 1,369

Previous

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests