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. Car with Physics Simulation: Control Individual Wheels

Car with Physics Simulation: Control Individual Wheels

Scheduled Pinned Locked Moved 3D Blocks
1 Posts 1 Posters 818 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

    Introduction

    In an earlier article, you learned how to steer or drive a car with physics simulation.

    Sometimes you may need to control the 4 wheels individually. For example, you might want to turn them to different directions. You’ll learn how to do that in this article.

     
     

    Set Wheel Directions Individually

    You can use the following block to set the direction of each wheel:

    6921722c-5019-481c-a641-70391e02182b-image.png

     
    The first 4 inputs are the direction values for each of the 4 wheels: LF (left front), RF (right front), LB (left back) and RB (right back). Usually, you should put in direction values between -90 and 90 degrees.

    The last input is the name of the physics-based car. You can leave this input blank if the car is already the selected sprite object.

    For example, the following block will turn the 4 wheels to 45 degrees and -45 degrees, so that they form a circle path:

    7470cba6-0cd5-43bd-8651-5c67d28728c2-image.png

     
    The wheels will look like this:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/ab1d377d-1449-48f4-a7be-54e9e189a588.gif" width="470" style="border-radius: 5px; border: 1px solid #29622d;">

     
     

    Set Engine Force for Each Wheel Individually

    You can use the following block to set the engine force for each wheel:

    400b5955-25fa-4c35-8164-18d46268ef58-image.png

     
    The first 4 inputs are the engine forces applied to each of the 4 wheels: LF (left front), RF (right front), LB (left back) and RB (right back). If it is positive, that wheel will roll forward; if it is negative, then that wheel will roll backward.

    The brake level is set for the entire car, which is the percentage the speed will reduce each time this block runs.

    The last input is the name of the physics-based car. You can leave this input blank if the car is already the selected sprite object.

    For example, this block will drive the 2 left wheels forward and the 2 right wheels backward:

    5c9b1e3d-9177-4e4c-8956-d364a82ef2a2-image.png

    1 Reply Last reply
    0

    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