Object Go Missing During Runtime

Discussion and feedback on Construct 2

Post » Thu Sep 05, 2013 10:43 am

Hi Guys,

I can't seem to figure out why my object keep going missing during runtime.

In my sample below, my Player object will just disappear after a short while. No other objects or events are triggering it.

If I were to guess, the cause might be how I "loop" the ground image but still doesn't make sense.

Any help is very much appreciated. Thanks in advance.

https://dl.dropboxusercontent.com/u/200443531/endless_runner.capx
B
25
S
10
G
4
Posts: 40
Reputation: 4,218

Post » Thu Sep 05, 2013 10:48 am

Hello flipbox,
I just noticed it does not go missing. It just jumps to further right, out of screen. Will check code to see why.

Edit:

I think I know what happens. When you replace the ground with the new ground that should follow it, if the player is touching the ground, he also jumps to front with it. So it means platform behaviour moves the player along with the platform. Observe that if you jump, player does not move along with the platform. To solve, I suggest making two platforms in the same manner, and never move the platform that the player is standing to front. Instead, move the platform that has passed under the player to front. I hope I could describe it :)

Regards.Windwalker2013-09-05 11:11:33
B
18
S
4
G
1
Posts: 332
Reputation: 3,149

Post » Thu Sep 05, 2013 11:16 am

Hi Windwalker,

I'm still a bit confused. Could you make an example?

Thanks in advance :)
B
25
S
10
G
4
Posts: 40
Reputation: 4,218

Post » Thu Sep 05, 2013 6:16 pm

Your ground object is a bullet, and your player object is on top of it. Your ground object is moving to left with X speed and your player object is moving to right in X speed, so it feels like player is stationary.
But when your ground object reaches it's limit, you take it, and put it to the end (right) of itself. When you do this, if your player is touching the ground, it also takes the player to further right, along with itself. I don't even have dropboxaccount so it will be hard for me to send you back the capx. But as far as I know, there is a "wrap" behaviour you can use for the same effect. Suggest you take a look at it.
B
18
S
4
G
1
Posts: 332
Reputation: 3,149

Post » Fri Sep 06, 2013 1:37 am

Got it. Will check it out :)
B
25
S
10
G
4
Posts: 40
Reputation: 4,218


Return to Construct 2 General

Who is online

Users browsing this forum: Euduardo and 14 guests