How would I "attach" an object to another object in 3D perfectly?
-
JaecadeJnight ππ²ππ ππΌπΏππΊ ππ²πΉπ½π²πΏ 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:
and same for this one too:
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?
-
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
-
@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β
-
Please try again. The project is accessible now. The code is like this:
-
@info-creaticode Ok, Iβm gonna try to do that (hopefully it works). Thank you!
-
@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!
-
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.