# Morphing objects in OOP

**URL:** <https://forum.snap.berkeley.edu/t/morphing-objects-in-oop/22730>\
**Category:** Snap! Editor\
**Created:** [October 26, 2026, 6:57pm UTC](https://forum.snap.berkeley.edu/t/morphing-objects-in-oop/22730 "2026-10-26T18:57:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![r1a1u1l](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/r1a1u1l/32/46461_2.png) [@r1a1u1l](https://forum.snap.berkeley.edu/u/r1a1u1l)\
**Post date:** [October 26, 2026, 6:57pm UTC](https://forum.snap.berkeley.edu/t/morphing-objects-in-oop/22730/1 "2026-10-26T18:57:00Z")

</div>

Im trying to make a particle physics engine and in it i am using the built in snap library called Object Oriented Programming or OOP to store data for each particle. Ive seen people use this to make a custom data thpe with a custom way of showing it like the neural networks library and someone’s computer algebra system. I want to know if there are any easy ways to do this, maybe with a single costume to display it as or having a list of costumes to animate. Let me know if anyone finds an easy way to do this

---

<div class="post-metadata">

**Author:** ![ego-lay\_atman-bay](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/ego-lay_atman-bay/32/1395_2.png) [@ego-lay\_atman-bay](https://forum.snap.berkeley.edu/u/ego-lay_atman-bay)\
**Post date:** [October 26, 2026, 7:23pm UTC](https://forum.snap.berkeley.edu/t/morphing-objects-in-oop/22730/2 "2026-10-26T19:23:18Z")

</div>

The way to do it is to make a `_morph` value as a callable grey ring. I’m pretty sure it has the same scope as all other object methods. It returns the representation, either a costume, text, or list. You might also want to look into the shapes library for generating a costume based off of the particle values.

---

<div class="post-metadata">

**Author:** ![sathvikrias](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/sathvikrias/32/46818_2.png) [@sathvikrias](https://forum.snap.berkeley.edu/u/sathvikrias)\
**Post date:** [October 27, 2026, 3:24am UTC](https://forum.snap.berkeley.edu/t/morphing-objects-in-oop/22730/3 "2026-10-27T03:24:24Z")

</div>

Also, you can use \_type as a key to make the type work better with the existing type blocks.

---

<div class="post-metadata">

**Author:** ![r1a1u1l](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/r1a1u1l/32/46461_2.png) [@r1a1u1l](https://forum.snap.berkeley.edu/u/r1a1u1l)\
**Post date:** [October 27, 2026, 1:38pm UTC](https://forum.snap.berkeley.edu/t/morphing-objects-in-oop/22730/4 "2026-10-27T13:38:54Z")

</div>

Thanks both of your suggestions worked and this will make my life way easier. While your here, could you guys tell me what the clone() block does

---

<div class="post-metadata">

**Author:** ![r1a1u1l](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/r1a1u1l/32/46461_2.png) [@r1a1u1l](https://forum.snap.berkeley.edu/u/r1a1u1l)\
**Post date:** [October 27, 2026, 2:18pm UTC](https://forum.snap.berkeley.edu/t/morphing-objects-in-oop/22730/5 "2026-10-27T14:18:29Z")

</div>

Oh and also what do the inputs of “field [field name] of [object]” do

---

<div class="post-metadata">

**Author:** ![codingisfun2831t](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/codingisfun2831t/32/42120_2.png) [@codingisfun2831t](https://forum.snap.berkeley.edu/u/codingisfun2831t)\
**Post date:** [October 27, 2026, 2:25pm UTC](https://forum.snap.berkeley.edu/t/morphing-objects-in-oop/22730/6 "2026-10-27T14:25:44Z")

</div>

If the field is a ring, it will pass those inputs in to the ring for the result (the field reporter checks the type of a value; if its a normal value it returns it, else for rings it executes them.)

---

<div class="post-metadata">

**Author:** ![r1a1u1l](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/r1a1u1l/32/46461_2.png) [@r1a1u1l](https://forum.snap.berkeley.edu/u/r1a1u1l)\
**Post date:** [October 27, 2026, 2:42pm UTC](https://forum.snap.berkeley.edu/t/morphing-objects-in-oop/22730/7 "2026-10-27T14:42:29Z")

</div>

Okay. Now i only need to know what clone() does and Im good.

---

<div class="post-metadata">

**Author:** ![r1a1u1l](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/r1a1u1l/32/46461_2.png) [@r1a1u1l](https://forum.snap.berkeley.edu/u/r1a1u1l)\
**Post date:** [October 27, 2026, 2:44pm UTC](https://forum.snap.berkeley.edu/t/morphing-objects-in-oop/22730/8 "2026-10-27T14:44:41Z")

</div>

This post was flagged by the community and is temporarily hidden.

---

<div class="post-metadata">

**Author:** ![petermathijssen](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/petermathijssen/32/45672_2.png) [@petermathijssen](https://forum.snap.berkeley.edu/u/petermathijssen)\
**Post date:** [October 27, 2026, 2:50pm UTC](https://forum.snap.berkeley.edu/t/morphing-objects-in-oop/22730/9 "2026-10-27T14:50:45Z")

</div>

Please stay on topic.

---

<div class="post-metadata">

**Author:** ![r1a1u1l](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/r1a1u1l/32/46461_2.png) [@r1a1u1l](https://forum.snap.berkeley.edu/u/r1a1u1l)\
**Post date:** [October 28, 2026, 12:00am UTC](https://forum.snap.berkeley.edu/t/morphing-objects-in-oop/22730/10 "2026-10-28T00:00:01Z")

</div>

Another question, is it possible to make \_morph field an animation, kinda like how in processes, the gears spin when the process in running

---

<div class="post-metadata">

**Author:** ![codingisfun2831t](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/codingisfun2831t/32/42120_2.png) [@codingisfun2831t](https://forum.snap.berkeley.edu/u/codingisfun2831t)\
**Post date:** [October 28, 2026, 12:08am UTC](https://forum.snap.berkeley.edu/t/morphing-objects-in-oop/22730/11 "2026-10-28T00:08:19Z")

</div>

The gears in the thread icon is a animated symbol. (the symbols like in the menu buttons, or in blocks). Unless jens adds some extension for making SymbolMorphs, you cant

---

<div class="post-metadata">

**Author:** ![r1a1u1l](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/r1a1u1l/32/46461_2.png) [@r1a1u1l](https://forum.snap.berkeley.edu/u/r1a1u1l)\
**Post date:** [October 28, 2026, 12:25am UTC](https://forum.snap.berkeley.edu/t/morphing-objects-in-oop/22730/12 "2026-10-28T00:25:07Z")

</div>

How do i use the clone block tho

---

<div class="post-metadata">

**Author:** ![r1a1u1l](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/r1a1u1l/32/46461_2.png) [@r1a1u1l](https://forum.snap.berkeley.edu/u/r1a1u1l)\
**Post date:** [October 28, 2026, 12:32am UTC](https://forum.snap.berkeley.edu/t/morphing-objects-in-oop/22730/13 "2026-10-28T00:32:45Z")

</div>

I just realized that since the objects that these blocks return are functionally just lists, i can just make a list with the same format and it morphs just like expected

---

<div class="post-metadata">

**Author:** ![da-ultimate-creater](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/da-ultimate-creater/32/41654_2.png) [@da-ultimate-creater](https://forum.snap.berkeley.edu/u/da-ultimate-creater)\
**Post date:** [October 28, 2026, 12:34am UTC](https://forum.snap.berkeley.edu/t/morphing-objects-in-oop/22730/14 "2026-10-28T00:34:39Z")

</div>

You create a clone using the create a clone of [myself V].  
In order to control that clone, you place the desired script underneath a When I start as a clone block.

You could also make a clone using (a new clone of [myself V]

I think that was the question

---

<div class="post-metadata">

**Author:** ![r1a1u1l](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/r1a1u1l/32/46461_2.png) [@r1a1u1l](https://forum.snap.berkeley.edu/u/r1a1u1l)\
**Post date:** [October 28, 2026, 12:38am UTC](https://forum.snap.berkeley.edu/t/morphing-objects-in-oop/22730/15 "2026-10-28T00:38:18Z")

</div>

No Im talking about the clone block in OOP. This topics purpose is just for OOP.

---

<div class="post-metadata">

**Author:** ![r1a1u1l](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/r1a1u1l/32/46461_2.png) [@r1a1u1l](https://forum.snap.berkeley.edu/u/r1a1u1l)\
**Post date:** [October 28, 2026, 12:38am UTC](https://forum.snap.berkeley.edu/t/morphing-objects-in-oop/22730/16 "2026-10-28T00:38:32Z")

</div>

Its fine though

---

<div class="post-metadata">

**Author:** ![ego-lay\_atman-bay](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/ego-lay_atman-bay/32/1395_2.png) [@ego-lay\_atman-bay](https://forum.snap.berkeley.edu/u/ego-lay_atman-bay)\
**Post date:** [October 28, 2026, 12:44am UTC](https://forum.snap.berkeley.edu/t/morphing-objects-in-oop/22730/17 "2026-10-28T00:44:10Z")

</div>

I think it creates a copy of the object

---

<div class="post-metadata">

**Author:** ![r1a1u1l](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/r1a1u1l/32/46461_2.png) [@r1a1u1l](https://forum.snap.berkeley.edu/u/r1a1u1l)\
**Post date:** [October 28, 2026, 10:25am UTC](https://forum.snap.berkeley.edu/t/morphing-objects-in-oop/22730/18 "2026-10-28T10:25:19Z")

</div>

I know but i dont get what its for. What it seems like is exactky like the create abject block except before all of the normal inputs, there is a list input and whatever is inputted there is put in a new field at the beginning of the object called “…”  
I habe no idea what that is for. Its just a list ikoit and the same style of inputing with the object block

---

<div class="post-metadata">

**Author:** ![jens](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/jens/32/39797_2.png) [@jens](https://forum.snap.berkeley.edu/u/jens)\
**Post date:** [October 28, 2026, 10:36am UTC](https://forum.snap.berkeley.edu/t/morphing-objects-in-oop/22730/19 "2026-10-28T10:36:35Z")

</div>

a clone is not a copy, but a copy-on-write object, that delegates tasks it doesn’t handle itself to another prototype object, a concept also known as “inheritance”.

Check out the [delegation paper by Henry Lieberman](https://web.media.mit.edu/~lieber/Lieberary/OOP/Delegation/Delegation.html)which describes the concept.

---

<div class="post-metadata">

**Author:** ![r1a1u1l](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/r1a1u1l/32/46461_2.png) [@r1a1u1l](https://forum.snap.berkeley.edu/u/r1a1u1l)\
**Post date:** [October 28, 2026, 11:07am UTC](https://forum.snap.berkeley.edu/t/morphing-objects-in-oop/22730/20 "2026-10-28T11:07:01Z")

</div>

So then what do i input where if i want to test this out

[Next page](https://forum.snap.berkeley.edu/t/morphing-objects-in-oop/22730.md?page=2)
