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.