# Can the "player" pick up and carry and object?

**URL:** <https://forum.code.org/t/can-the-player-pick-up-and-carry-and-object/31512>\
**Category:** Unit and Lesson Discussion\
**Tags:** csd-unit-3-lesson-22\
**Created:** [October 22, 2019, 12:01pm UTC](https://forum.code.org/t/can-the-player-pick-up-and-carry-and-object/31512 "2019-10-22T12:01:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![heather.caster](https://avatars.discourse-cdn.com/v4/letter/h/e8c25b/32.png) [@heather.caster](https://forum.code.org/u/heather.caster)\
**Post date:** [October 22, 2019, 12:01pm UTC](https://forum.code.org/t/can-the-player-pick-up-and-carry-and-object/31512/1 "2019-10-22T12:01:09Z")

</div>

I have some students who want their player to pick up and carry an object. Can this happen?

---

<div class="post-metadata">

**Author:** ![mkmietowicz](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/mkmietowicz/32/6322_2.png) [@mkmietowicz](https://forum.code.org/u/mkmietowicz)\
**Post date:** [October 23, 2019, 5:17am UTC](https://forum.code.org/t/can-the-player-pick-up-and-carry-and-object/31512/2 "2019-10-23T05:17:25Z")

</div>

Hi @heather.caster,

I haven’t tried this, but it sounds like they might want to try creating two sprites: player and object. Then, if player is touching object, object.x and object.y become player.x and player.y. Maybe they’ll even want the costumes to change to make it look better? If you link to the project someone can take a closer look.

The student would also have to figure out a way for the player to put the object back down.

Thanks,  
Michael K.

---

<div class="post-metadata">

**Author:** ![heather.caster](https://avatars.discourse-cdn.com/v4/letter/h/e8c25b/32.png) [@heather.caster](https://forum.code.org/u/heather.caster)\
**Post date:** [October 23, 2019, 2:55pm UTC](https://forum.code.org/t/can-the-player-pick-up-and-carry-and-object/31512/3 "2019-10-23T14:55:43Z")

</div>

Thank you! Here is the project so far…

> **[Check out what I made](https://studio.code.org/projects/gamelab/L4xJgZnHjFBej2lGEN9_he8JE5qJjl_20ESvWOyUVbU)**
>
> I wrote the code myself with Code.org

---

<div class="post-metadata">

**Author:** ![mwood](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/mwood/32/4941_2.png) [@mwood](https://forum.code.org/u/mwood)\
**Post date:** [October 26, 2019, 6:27pm UTC](https://forum.code.org/t/can-the-player-pick-up-and-carry-and-object/31512/4 "2019-10-26T18:27:37Z")

</div>

So [here’s a quick remix of his project.](https://studio.code.org/projects/gamelab/UlwcnjWl8htL2z1Z6KSc0N8lllwJkg-39woe4vWlliE/edit) I wasn’t 100% sure what the reset was supposed to do as it conflicts with the initial instruction of what to do if the fishingPole is touching the fish, so I commented it out in my version, but this is a quick demo of how the fishing pole could pick up the green fish.

Once it touches the fish, the x & y values of the fish become directly related to the x & y value of the fishingPole making them appear to be connected (while still remaining two distinct sprites).

Of course, he will then probably want to figure out how to “disconnect” them, perhaps when the fish gets dragged high enough on the screen or makes it into the boat?

Hope this helps a little.

Mike

---

<div class="post-metadata">

**Author:** ![heather.caster](https://avatars.discourse-cdn.com/v4/letter/h/e8c25b/32.png) [@heather.caster](https://forum.code.org/u/heather.caster)\
**Post date:** [January 8, 2020, 1:58pm UTC](https://forum.code.org/t/can-the-player-pick-up-and-carry-and-object/31512/5 "2020-01-08T13:58:06Z")

</div>

Yes, this helped tremendously! Thank you!
