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. Help
  3. How would I "attach" an object to another object in 3D perfectly?

How would I "attach" an object to another object in 3D perfectly?

Scheduled Pinned Locked Moved Help
3d-blockshelpquestion
7 Posts 2 Posters 1.7k Views 1 Watching
  • 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.
  • JaecadeJnightJ Offline
    JaecadeJnightJ Offline
    JaecadeJnight
    Mod Helper
    wrote on last edited by jeffreyrb03-gmail
    #1

    Say I have a player object, and it’s a person model. And I also have another, a hat object, and it’s an Engineer Hat model. I know how to position it right above the player, so it looks like the player is wearing the crown, and that works, but only works when the player is static and not moving. (My player is moved with WASD). I had a piece of code (forgot to save it), but it’s not perfect. The crown stays backs and slowly follows the player’s head, and when the character stops moving, it returns back to its normal place.

    I assumed this block would do the job but it doesn’t:
    0cdecba8-6168-4ba1-8dcb-52394d511daa-image.png
    and same for this one too:
    89265491-0f41-4819-8c28-2e07ab33956b-image.png

    I don’t really have a good code example incase you ask, sorry, but how would I just like make 2 objects become one (smoothly too), like the hat and the player, so when the player moves or turns, so does the hat because the hat is attached to the player seamlessly?

    #LLJW
    <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

    CreatiCodeI 1 Reply Last reply
    0
    • JaecadeJnightJ JaecadeJnight

      Say I have a player object, and it’s a person model. And I also have another, a hat object, and it’s an Engineer Hat model. I know how to position it right above the player, so it looks like the player is wearing the crown, and that works, but only works when the player is static and not moving. (My player is moved with WASD). I had a piece of code (forgot to save it), but it’s not perfect. The crown stays backs and slowly follows the player’s head, and when the character stops moving, it returns back to its normal place.

      I assumed this block would do the job but it doesn’t:
      0cdecba8-6168-4ba1-8dcb-52394d511daa-image.png
      and same for this one too:
      89265491-0f41-4819-8c28-2e07ab33956b-image.png

      I don’t really have a good code example incase you ask, sorry, but how would I just like make 2 objects become one (smoothly too), like the hat and the player, so when the player moves or turns, so does the hat because the hat is attached to the player seamlessly?

      CreatiCodeI Online
      CreatiCodeI Online
      CreatiCode
      wrote on last edited by info-creaticode
      #2

      @jeffreyrb03-gmail

      Setting the avatar to be the parent of the hat is the common solution. Can you share the project? We will investigate why it doesn’t work.

      And here is a simple example:

      https://play.creaticode.com/projects/66d91bb68d45d7f8ac438f76

      JaecadeJnightJ 1 Reply Last reply
      1
      • CreatiCodeI CreatiCode

        @jeffreyrb03-gmail

        Setting the avatar to be the parent of the hat is the common solution. Can you share the project? We will investigate why it doesn’t work.

        And here is a simple example:

        https://play.creaticode.com/projects/66d91bb68d45d7f8ac438f76

        JaecadeJnightJ Offline
        JaecadeJnightJ Offline
        JaecadeJnight
        Mod Helper
        wrote on last edited by
        #3

        @info-creaticode My project is shared, but you won’t find the code there because like I said i forgot to save it, so sorry. But the project you provided as the example says “Not found”

        #LLJW
        <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

        CreatiCodeI 1 Reply Last reply
        0
        • JaecadeJnightJ JaecadeJnight

          @info-creaticode My project is shared, but you won’t find the code there because like I said i forgot to save it, so sorry. But the project you provided as the example says “Not found”

          CreatiCodeI Online
          CreatiCodeI Online
          CreatiCode
          wrote on last edited by
          #4

          @jeffreyrb03-gmail

          Please try again. The project is accessible now. The code is like this:

          c95b0652-7784-4502-8866-5ae354a8c95a-image.png

          JaecadeJnightJ 1 Reply Last reply
          1
          • CreatiCodeI CreatiCode

            @jeffreyrb03-gmail

            Please try again. The project is accessible now. The code is like this:

            c95b0652-7784-4502-8866-5ae354a8c95a-image.png

            JaecadeJnightJ Offline
            JaecadeJnightJ Offline
            JaecadeJnight
            Mod Helper
            wrote on last edited by
            #5

            @info-creaticode Ok, I’m gonna try to do that (hopefully it works). Thank you!

            #LLJW
            <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

            JaecadeJnightJ 1 Reply Last reply
            0
            • JaecadeJnightJ JaecadeJnight

              @info-creaticode Ok, I’m gonna try to do that (hopefully it works). Thank you!

              JaecadeJnightJ Offline
              JaecadeJnightJ Offline
              JaecadeJnight
              Mod Helper
              wrote on last edited by
              #6

              @jeffreyrb03-gmail so i’ve realized my mistakes, it might’ve been a little bit of the wrong object being selected, because the issues I would face were the hat would be controlled instead and I’d have a walking hat and no person, and varieties of that and the camera just failing because of idk. Also maybe because in your example you had “and update position/scale ( No )” and I had yes .

              I still haven’t fixed my issue yet but this did help me get closer to achieving the effect I want, and it’s gonna be awesome when it’s done, so thank you!

              #LLJW
              <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

              CreatiCodeI 1 Reply Last reply
              0
              • JaecadeJnightJ JaecadeJnight

                @jeffreyrb03-gmail so i’ve realized my mistakes, it might’ve been a little bit of the wrong object being selected, because the issues I would face were the hat would be controlled instead and I’d have a walking hat and no person, and varieties of that and the camera just failing because of idk. Also maybe because in your example you had “and update position/scale ( No )” and I had yes .

                I still haven’t fixed my issue yet but this did help me get closer to achieving the effect I want, and it’s gonna be awesome when it’s done, so thank you!

                CreatiCodeI Online
                CreatiCodeI Online
                CreatiCode
                wrote on last edited by
                #7

                @jeffreyrb03-gmail

                Yes. Most likely, you had the hat as the “selected sprite object” instead of the person, so when you use a motion block, the hat is moved.

                1 Reply Last reply
                1

                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