Get and Set Actor Properties

Edited

Working with actor properties is like a Tynker superpower, once you get the hang of it. Here’s how you can use the Actor Properties block, which returns a value. It looks like this:

It has two parameters:

  • The Property you want to retrieve. This can be information like the Actor’s current x position, costume name, density, and so on. Click the dropdown menu in the block to see all the options.

  • The Actor whose property you want to retrieve. In addition to working with actors, you can retrieve the properties of the screen edges and the mouse-pointer.

If you try to retrieve a property that does not exist or doesn’t “make sense” (for example, the volume of the mouse-pointer), this block returns nothing.

In the same way, you can use the set property block to change an actor’s properties: