Navigation

    CreatiCode Scratch Forum

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

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

    Help
    3d-blocks help question
    2
    7
    449
    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.
    • jeffreyrb03-gmail
      JaecadeJnight Mod Helper last edited by jeffreyrb03-gmail

      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>

      info-creaticode 1 Reply Last reply Reply Quote 1
      • info-creaticode
        CreatiCode @jeffreyrb03-gmail last edited by info-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

        jeffreyrb03-gmail 1 Reply Last reply Reply Quote 1
        • jeffreyrb03-gmail
          JaecadeJnight Mod Helper @info-creaticode last edited by

          @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>

          info-creaticode 1 Reply Last reply Reply Quote 1
          • info-creaticode
            CreatiCode @jeffreyrb03-gmail last edited by

            @jeffreyrb03-gmail

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

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

            jeffreyrb03-gmail 1 Reply Last reply Reply Quote 1
            • jeffreyrb03-gmail
              JaecadeJnight Mod Helper @info-creaticode last edited by

              @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>

              jeffreyrb03-gmail 1 Reply Last reply Reply Quote 1
              • jeffreyrb03-gmail
                JaecadeJnight Mod Helper @jeffreyrb03-gmail last edited by

                @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>

                info-creaticode 1 Reply Last reply Reply Quote 1
                • info-creaticode
                  CreatiCode @jeffreyrb03-gmail last edited by

                  @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 Reply Quote 1
                  • First post
                    Last post