*SOLVED* How do I Grab Collectibles Without Lag

0 favourites
  • 8 posts
From the Asset Store
In this template the music plays without looping in your game
  • 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.

  • Are you using the Solid or Physics behavior on your collectibles? If so remove them / turn them off and see what happens.

  • Hey ggibson1 i disabled both. Now when the player collides he stops until the collectibles are destroyed.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

  • 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.

  • 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.

  • jeffige

    I do the same sort of thing in my game... I turn the physics off right after they stop moving.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)