How do I efficiently handle picking up items

0 favourites
  • 5 posts
From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • Simple question: what is the best way to pick up, say, crate-type items (act as solids when on the ground) that can be thrown, pushed, lifted and gently put down.

    Any ideas?

    Thanks for reading!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • My guess would be something along the lines of, enable the physics behavior on the crate then, when the player is within x distance of crate and clicks it, set the crates position to characters arms x,y. For the throwing part, i'd say have your characters arms set angle towards mouse x,y and when right button clicked, throw the crate towards angle of mouse position. I can see about coming up with a basic layout if you need it.

  • Good start, how to deal with situations like overlapping with two or more crates at the same time?

  • Use the 'Solid' behavior on the crate as well and they will not overlap, they will stack as though they are solid objects. As far as dealing with the rest of it goes, most of it is handled by the physics behavior. If you have 3 crates stacked and knockout the bottom one, the other 2 will fall as though gravity is working on them.

    Hope it helps!

  • Yeah it sure does, thanks!

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