Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • CreatiCode
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

CreatiCode Scratch Forum

  1. CreatiCode Forum
  2. Knowledge Base
  3. 3D Blocks
  4. Add Trails to Meshes

Add Trails to Meshes

Scheduled Pinned Locked Moved 3D Blocks
1 Posts 1 Posters 888 Views
  • 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.
  • CreatiCodeI Offline
    CreatiCodeI Offline
    CreatiCode
    wrote on last edited by admin
    #1

     

    Prerequisite

    • Adding Boxes
    • Names and Sprite Objects

     

    Introduction

    Sometimes we have objects that move really fast, such as a ball or a bullet. We can add trails to such objects to show their moving paths.

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/3e9d585d-3dfc-4490-af26-cb8b7a3aabd5.gif" width="450" style="border-radius: 5px; border: 1px solid #29622d;">

    Note that the trail is thicker at its head, and it gradually shrinks in width until it disappears at its tail.

     

    The “Add Trail” Block

    The “add trail” block adds a new trail to the current sprite object selected for the current sprite. Let’s refer to that object as the “target object”.

     
    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/8ec10b70-9b10-4d47-a492-4dfbff22d707.png" width="700" style="">

     

    Diffusion and Emission Colors

    You can set these 2 colors to the trail mesh, just like how you update the color of a box. Note that often we want to make the tail glow some lights, so the emission color will be used to set the color of the glow.

     

    Width

    This value controls the width of the trail at its head (the thickest point). Note that the trail will be drawn with the same width at its head no matter from which angle our camera is looking at it.

     

    Segments

    This value controls the length of the trail indirectly. Each segment corresponds to one of the previous positions of the target object. If the Segments value is 50, then the trail will be drawn along a path that connects all the past 50 segments. So when the target object is moving faster, the distance between the segments will be longer.

     

    Demo

    In this demo, a sphere moves left and right repeatedly, and a trail is added to show its path.

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/7602f243-8a3d-4c22-b16d-41f49d7792bd.gif" width="450" style="border-radius: 5px; border: 1px solid #29622d;">

    In the program, there are 2 places worth mentioning.

    1. To make the trail glow colors, we need to add the trail itself to the glow layer, not the target object for the trail.
    2. After adding the trail, it becomes the sprite object itself. So to make the original target object “s” to move left and right, we need to select that object first.

    e4ad241a-099b-4336-9502-466a117e661c-image.png

     
    Try it yourself here:

    https://play.creaticode.com/projects/63e4e69aef66187247332746

    1 Reply Last reply
    0
    • CreatiCodeI CreatiCode pinned this topic on

    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

    With your input, this post could be even better 💗

    Register Login
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode