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
10
S
2
Posts: 14
Reputation: 585

Post » Thu Dec 15, 2016 12:10 am

You need to filter the object before unpinning it.
Image
B
108
S
24
G
18
Posts: 1,376
Reputation: 22,830

Post » Thu Dec 15, 2016 12:27 am

What do you mean by filter it?
B
10
S
2
Posts: 14
Reputation: 585

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
22
G
258
Posts: 3,791
Reputation: 143,198


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 5 guests