Problem with picking up item and putting it back

Get help using Construct 2

Post » Sun Jun 14, 2015 1:02 am

Hi, I've got an issue with a cup item, you click it to put it on your mouse so that you can feed it to the character, and when you click the empty table it should go back onto the table, it works.. kind of.. when you click the table it doesn't work if your mouse is over where the cup would originally be, its like theres an invisible cup in the way. So to fix this I made sure to make a few different sprites and moved them off screen to guarantee that there is no cup in the way, but it still wont work.. I need someone whos good at going through crazy nonsense coding from a beginner and find a fix because after weeks of trying I cant do it.. is this the right place to ask? and is it safe to post a game? I can't post just the cup part because I think its some kind of inflicting thing with all the code.. so I'm not sure what to do. any responses would be appriciated though :)
B
14
S
4
G
1
Posts: 32
Reputation: 1,437

Post » Sun Jun 14, 2015 7:44 am

Hey Jared,

break it down to just the cup and the table and post it here and I will fix it for you (unless someone else gets to it first :)). It should be a good example for others to learn from too.
ImageImage
B
123
S
23
G
7
Posts: 1,071
Reputation: 13,091

Post » Sun Jun 14, 2015 10:42 am

Well, I'm interested to help.
Though, I will only be able to do this after monday...
It's time for me to return the favor :)
B
32
S
9
G
9
Posts: 132
Reputation: 5,370

Post » Mon Jun 15, 2015 4:51 am

Ok I guess the forum got rid of the easy attachment system so heres a dropbox of the capx.. https://www.dropbox.com/s/kqyxfo3vht6ee ... .capx?dl=0

I took everything unnecessary out, but there are some items in there that seem to effect it if I delete them so just ignore the weird food and body parts lol its a weird game.

Also! there is an easy fix, it's to change the collision points on the cup when picking it up to having no collision, buuuuut I can't do that because while the cup is in your hand, you need the same collisions to interact with the character.. so thats kind of where I'm at a loss. Thanks for taking a look! Lemme know what you find :)

And just a refresher, the problem is putting the cup back onto the table, just click it and click down again.. you'll see what I mean.
B
14
S
4
G
1
Posts: 32
Reputation: 1,437

Post » Mon Jun 15, 2015 7:26 am

Hope this is what you are looking for :)
https://dl.dropboxusercontent.com/u/152 ... 0Test.capx
It's time for me to return the favor :)
B
32
S
9
G
9
Posts: 132
Reputation: 5,370

Post » Mon Jun 15, 2015 2:35 pm

Almost! But it needs to be when I click on the cup itself, this one works if I click anywhere. although I might be able to do it myself, I'll have to mess with it more when I get off work, Thank you so much!
B
14
S
4
G
1
Posts: 32
Reputation: 1,437

Post » Tue Jun 16, 2015 4:00 am

Here you go Jared.

https://db.tt/lFyjJv62

What you can do now is instead of having an active variable for every item you want moved, simply add all the objects you want to a family and then give the family itself the needed variables for movement. This will save you coding up the same behaviour for all the items.

The other option is to have all the items in a single object.
ImageImage
B
123
S
23
G
7
Posts: 1,071
Reputation: 13,091


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 47 guests