How do I unpin from one object but not another?

Get help using Construct 2

Post » Wed Dec 14, 2016 11:41 pm

I'm working on a game where an enemy can steal an object from a player, but both the player and enemy can only hold one object at a time. These objects are then pinned to the players/enemies body. The problem is is whenever a player OR enemy picks up a new item, it unpins all previous items they could have picked up, but it ALSO unpins whatever object the other is holding.

Is there a better way to manage who has what pinned to them?

Image
B
7
S
1
Posts: 8
Reputation: 398

Post » Thu Dec 15, 2016 12:10 am

You need to filter the object before unpinning it.
Image
B
106
S
23
G
17
Posts: 1,356
Reputation: 22,135

Post » Thu Dec 15, 2016 12:27 am

What do you mean by filter it?
B
7
S
1
Posts: 8
Reputation: 398

Post » Thu Dec 15, 2016 12:42 am

There are different "Pick" events. You need to pick the specific objects you care about first. We'd need more details to be more specific. One way is to store the UID of the player/enemy on the object when pinned, then you can pick by the parent's UID to get the right object to unpin. There are many other ways to d this.
ImageImageImage
B
71
S
21
G
230
Posts: 3,687
Reputation: 128,845


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, MikaelS, nahima and 12 guests