How do I pick up an throw objects (knocking on the door)

0 favourites
  • 4 posts
From the Asset Store
Throw daggers and hit the most fruit! Watch out for the wind, if you run out of daggers you'll lose the game!
  • Hello,

    I know this question has been asked many of times and I feel like I am sorta beating the dead horse with this question.

    Basically I am making a platformer where the player can pickup and throw objects left, right and up. I have detection box named “Carry” that is pinned in front of the player with a set Boolean variable to that object named “Carrying” set to false on start. When the “Carry” object is overlapping the throw-able box and the player presses the X button, that throw-able box is then pinned to the Carry box, the “Carrying” variable is then set to true. Upon pressing the X button again while carrying the throw-able box the bullet is enable on the box and the box shoots off from the “Carry” detection box in the direction it’s pointing and the Carrying variable is set back to false…

    Unfortunately, this isn’t working for me. I looked and searched at past questions, tutorials, .xcap examples files, etc on the C2 forums. The error I get is the throw-able box shoots off instantly upon the carry detection overlapping the throw-able box.

    I know I am on the right track with having the “Carrying” variable keeping track of the player is holding an object. I don’t understand what I am doing wrong. I was really hoping to avoid asking for help on this because it seems so simple in theory… But here I am…

    Any help on this issue would be much appreciated. I know I am on the right track on getting this to work, I been struggling with this for too long. Most-likely I am over thinking concept.

    Here is my .xcap file: dropbox.com/s/robk1jyziuxe7qq/GrabAndThrow.capx

    Thanks,

    -SambaMaster-

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Use physics and be sure the land behaviour is physics and immoveable is yes

  • Use physics and be sure the land behaviour is physics and immoveable is yes

    Thanks fathijack1999,

    I tried the adding and enabling the physics to both the throw-able box and land with inmmoveable to yes. I am stilling having the same issue. the throw-able box shoots off upon pressing X button on the first input instead of the second X input.

  • > Use physics and be sure the land behaviour is physics and immoveable is yes

    >

    Thanks fathijack1999,

    I tried the adding and enabling the physics to both the throw-able box and land with inmmoveable to yes. I am stilling having the same issue. the throw-able box shoots off upon pressing X button on the first input instead of the second X input.

    Never Mind I finally figured it out!!!

    So 1# I uploaded the wrong file to be examined (My bad).

    2# There were a set of events I was missing that are needed to detect whether the "Carrying" Boolean Variable is true or false.

    3# Again a thank you goes out to fathijack1999 for taking the time out for responding to my question.

    4# Lastly, here is the working downloadable link to the .xcap file if anyone here is interested in a 2D platformer pick up and throw mechanic in their side-scrolling games: dropbox.com/s/q307h6gh3rt32ft/GrabAndThrowFINAL.capx

    Godspeed in your gaming projects!

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