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

Get help using Construct 2

Post » Mon Jun 13, 2016 2:46 am

Message: SambaMaster can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
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… :oops:

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: https://www.dropbox.com/s/robk1jyziuxe7qq/GrabAndThrow.capx?dl=0

Thanks,

-SambaMaster-
B
3
Posts: 3
Reputation: 181

Post » Mon Jun 13, 2016 4:48 am

Use physics and be sure the land behaviour is physics and immoveable is yes
B
13
S
5
G
4
Posts: 119
Reputation: 3,353

Post » Mon Jun 13, 2016 9:36 pm

fathijack1999 wrote: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.
B
3
Posts: 3
Reputation: 181

Post » Tue Jun 14, 2016 3:58 am

Message: SambaMaster can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
SambaMaster wrote:
fathijack1999 wrote: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!!! :D :D :D

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. :geek:

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: https://www.dropbox.com/s/q307h6gh3rt32ft/GrabAndThrowFINAL.capx?dl=0

Godspeed in your gaming projects! 8-)
B
3
Posts: 3
Reputation: 181


Return to How do I....?

Who is online

Users browsing this forum: Armench and 14 guests