Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    Get Properties About Physics Body

    3D Blocks
    1
    1
    298
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • info-creaticode
      CreatiCode last edited by admin

      Introduction

      When an object is linked with a physics body, its position, rotation and speed are all controlled by that body. Therefore, we need to use the following reporter block to find out such properties:

      c432dd2c-1d0b-4396-81a2-0870b200e136-image.png

       
      The second input is an optional input. It allows you to specify the name of the object. If it is left blank, the current sprite object’s name will be used.

      The first input is the name of the property to query about:

      • Position: The X/Y/Z positions of the physics body, which is the location of the origin point (the center point) of the physics body.

      • Rotation: The rotation direction around the X/Y/Z axes for the physics body.

      • Speed: The moving speed of the physics body in the X/Y/Z directions.

      • Rotation Speed: the rotation speed around the X/Y/Z axes.

       
       

      Example

      For example, here is a program with a sphere jumping over a static box:

      113d4e01-2ef4-4b2f-bd0a-1454c440ce38-image.png

      We can get the position and speed of the sphere like this:

      1 Reply Last reply Reply Quote 0
      • First post
        Last post