Physics properties: Active, static, and shape

Edited

Let’s look at some other Physics actor settings. Try adding some new actors to your project (Add Actor > Media Library) and try these code blocks yourself.

Active

An active actor is one that will collide with others and will be affected by gravity. By setting active to false, actors won’t interact at all—they’ll be artwork in the background of your project. In short, inactive actors don’t interact with physics actors.

Here’s the code for an inactive character:

Static

By using the set static true block, you can make an actor stay fixed in place (that is, unaffected by gravity). The actor can still collide with other physics actors, but it won’t move.

When can you use this setting? For example, if you want a platform to stack items on or want to build the walls of a maze. That is, you want the object to be static (fixed in place), but also active (interact with other physics objects).

You can make this happen with a script like this:

Shape

You can also use these blocks to make Tynker treat an actor like a ball or a box, using the set shape command:

Try adding some bricks or other objects to your project and experiment with these blocks yourself.