[Solved]Disable picking up object

So i have a pick up event for an object (centrosome left/right):

When Grab is pressed the nearest object changes its position to Neu.Point (Neu is my character), and when Grab is released the object’s position is changed to current position of Neu, kind of like dropping it.

For my centrosome left and right I have an “anchor” for them so when Neu drops them and it collides with the anchor, they stay to that anchor.

The anchor are these small blue and red boxes to the farthest opposite sides.

Now, if the player puts the CentrosomeRight to the left anchor and the CentrosomeLeft to the right anchor. I still want the centrosome to stay on whichever anchor they are collided with.

So I did this event below, I considered the possibility, and it works:

My problem is that when the centrosome is anchored to the anchor, Neu shouldn’t be able to pick it up. In my code, when a centrosome is on the anchor, that particular centrosome won’t be picked up anymore. But, the other centrosome also can’t be picked up even though its not on an anchor yet.

Help :face_holding_back_tears:

In the first event, you have a copy of those events for left? I’m not seeing any reason why putting a centrosome on an anchor wouldn’t let the other centrosome move. Unless the variables needed to move a centrosome (Begin and IsHolding) aren’t getting reset after dropping the first object. So in the events where the centrosome is in collision with the place markers, are these sub events to “Button grab was released” event? If not, maybe the event you used in the first picture to set IsHolding to false is not being done, so Neu can not carry anymore. If you carry a centrosome around and drop it somewhere that is not an anchor, can you then go to the other centrosome and carry it around?

Apologies, yes I have a copy for the left centrosome:

Nope, the collision with the place markers is a separate group event.

Yep, Neu can carry the other when the other is not on an anchor. Only when a centrosome is on an anchor that the other can’t be picked up.

If you add “Change the variable IsHolding of Neu set to false” in your “centro is in collision with anchor” events does it change anything?

Do I add it under the condition or under action?

Try adding it here.

I added it, but now Neu can carry both centrosome even though they are in their anchors.

Good, problem solved.

Now this next problem is because there is no event saying “Neu can’t carry a centrosome if it’s already been placed”. You could add a new condition that Neu can’t carry a centrosome if it’s in collision with an anchor.

1 Like

ohhhhh right :sweat_smile: so that’s what’s missing. Thank you Lucky!

Luckyyyy, I thought I got what the problem was but I’m second guessing myself hahah.

If I add the condition “X position of CentrosomeRight = CentroAnchorRight.X()” here

Wouldn’t it not work since I’m setting the isholding and being carried true?

I’m not sure if I’m making sense or if I understood it correctly

I added it here:

It might work better if the x position of centrosomeRight did not = the x position of the anchor right or left. Right now it looks like Neu can only pick up CentrosomeRight if it is in the same x position as anchor right or left.

But did you not find the CentrosomeRight is in collision with (inverted) condition or is it not working as expected?

Thank you Lucky, I will try this again tomorrow, I have to rest :pleading_face:

1 Like

Hello @Lucky-j Good day :blush:

I did this, and it still not working as expected

The collision checks should not be in an OR statement, they should both be true, it’s not in collision with any anchor, left or right. However, that may not be the only problem depending on what you mean by not working as expected. Take them out of the if statement, run it and let me know what it’s doing.

1 Like

It worked :tada: thank youuuuuu

1 Like