*SOLVED* How do I Grab Collectibles Without Lag

Get help using Construct 2

Post » Fri Jan 02, 2015 5:16 pm

When my player is running and collides with a collectible there is a split second lag in the players movement.
i.e: The player is running, collides with collectible, hesitates for a split second then continues running.

How can i get rid of that lag?

Right now i have the collectibles being spawned with collisions enabled. "On collision with another object" the collectibles collisions are disabled-then flash 0.1 on, flash 0.1 off for 1 second then destroy.

I've tried "overlapping at offset" X-10, Y-0 which works but only from the left side of the collectible (on the right side the player stops dead in his tracks when colliding with the collectible). I've searched the forums and used my dear friend Google, but no luck on finding how to get the "overlapping at offset" to work on the positive and negative X axis.

A big thank you to anyone that can help me figure this out.
Last edited by jeffige on Fri Jan 02, 2015 7:47 pm, edited 1 time in total.
B
38
S
18
G
19
Posts: 664
Reputation: 14,112

Post » Fri Jan 02, 2015 5:45 pm

Are you using the Solid or Physics behavior on your collectibles? If so remove them / turn them off and see what happens.
B
21
S
5
Posts: 196
Reputation: 1,984

Post » Fri Jan 02, 2015 5:53 pm

Hey @ggibson1 i disabled both. Now when the player collides he stops until the collectibles are destroyed.
B
38
S
18
G
19
Posts: 664
Reputation: 14,112

Post » Fri Jan 02, 2015 7:04 pm

Ok then I do not know what could be stopping it. Without Solid or Physics behaviors objects have no "body" to them to do any stopping... it must be something you are doing in an event.
B
21
S
5
Posts: 196
Reputation: 1,984

Post » Fri Jan 02, 2015 7:47 pm

Hey @ggibson1 thanks for the replies, and putting me on the path of correctness.

I went back and DELETED ALL of the solid & physics behaviors for the collectibles (individual and family). At 1st they acted like a wall. So I added the physics behavior back to the family and after messing around with the properties it works like a charm.

Thank you again.
B
38
S
18
G
19
Posts: 664
Reputation: 14,112

Post » Fri Jan 02, 2015 9:36 pm

@jeffige

Glad you got it working.

One thing to keep in mind is that Physics behaviors eat up performance so unless your collectibles actually need physics you shouldn't add the behavior. By default sprites move right through each other... they trigger collision events, but they do not stop or slow each other down at all. So if you are seeing them effect each other it is because of either a behavior or events causing them to actually "touch" each other when they normally do not.
B
21
S
5
Posts: 196
Reputation: 1,984

Post » Sun Jan 04, 2015 1:40 am

Hey @ggibson1

The only reason the collectibles have the physics is because when the player breaks a crate the collectibles shoot upward in an event: move random pixels at a random angle. Right now the collectibles bounce just a bit when they land. I've tried not using the physics but it looks weird when the collectibles are spawned then fall like a rock, sticking to the ground.

If i could figure out how to make it look a bit more natural w/o the physics i would surely use that instead.
B
38
S
18
G
19
Posts: 664
Reputation: 14,112

Post » Sun Jan 04, 2015 2:24 am

@jeffige

I do the same sort of thing in my game... I turn the physics off right after they stop moving.
B
21
S
5
Posts: 196
Reputation: 1,984


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 13 guests