What is causing my sprite to move? (.gif included)

Get help using Construct 2

Post » Sat Jan 17, 2015 11:26 pm

I think something exists here that is just beyond explanation. I have remade the system successfully in another .capx.

The only way that I can recreate this bug happening is by adding a solid behavior to the player, thus screwing with the enemy's LOS behavior.

Here it is fully working, with no platformer behavior, on standard LOS settings. I really appreciate all of your help, but I think this is a sign that I need to take all assets and settings to a new blank project.

The only thing I can come up with, is that I started this projected using the "Platformer" template, and something inside of there is causing this, and when I do it on a "Blank" project template, it works fine.
You do not have the required permissions to view the files attached to this post.
B
20
S
5
Posts: 108
Reputation: 1,473

Post » Sun Jan 18, 2015 2:06 pm

General J wrote:Image

The problem here is that the state is "idle" for 1.25 seconds before it changes to "stop" and for every tick during those 1.25 seconds you are running those actions.

So it's like:
Tick 1: Set speed, wait 1 second, set movement enabled, wait 0.25 seconds, set movement disabled
Tick 2: Set speed, wait 1 second, set movement enabled, wait 0.25 seconds, set movement disabled
Tick 3: Set speed, wait 1 second, set movement enabled, wait 0.25 seconds, set movement disabled
Tick 4: Set speed, wait 1 second, set movement enabled, wait 0.25 seconds, set movement disabled
etc...

1.25 seconds after the first tick where state was "idle", it will set the movement disabled and the state to "stop", but you still have 1.25 seconds worth of events queued up that will set it to enabled again. The movement is going to be set enabled - disabled - enabled - disabled until all those queued up actions finish running and you get that extra movement that you see.

What you want is to only run this block of events once when the state becomes "idle" which you can do using "System: Trigger once".

Here's a capx that highlights the problem:
You do not have the required permissions to view the files attached to this post.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,650

Previous

Return to How do I....?

Who is online

Users browsing this forum: Anna Nehves Br, divsyntax, volumetv and 20 guests