Hello! I was recently playing around with this amazing audio visualizer, (Courtesy of @SeasonedRiceFarmer - Get it here) and I was trying to “attach” it to the player so when the players moves around the audio visualizer moves around with it, and make the player stay in the middle.
How can I achieve this? For reference, here’s the audio visualizer:
i have welded it using a script and i have published it on roblox so you can get it
put the folder inside StarterCharacterScripts.
Summary
I used the script to weld each and every part to the root part.
Then i moved the model to the character’s humanoid position at the start and welded the root part to HumanoidRootPart
*and ofc i also disabled can collide and anchor properties so the character could move.
The root part is something i added using the studio aligned the model with the root part; using the align position plugin and made the root part transparent as well.
i noticed that too, sadly it is something i have no idea how to fix and it should be something to do with the original script,
i’ll tweak around and see if i can find something and post it here if and only if i find a solution
parta=script.Parent.Parent.Parent:WaitForChild("HumanoidRootPart")
for i,v in pairs(script.Parent:GetChildren()) do
if v~=script and v.Name~="Root" then
w=Instance.new("WeldConstraint")
w.Part0=v
w.Part1=script.Parent.Root
w.Parent=v
end
end
script.Parent:MoveTo(parta.Position)
weld=script.Parent:WaitForChild("Root"):WaitForChild("WeldConstraint2")
weld.Part0=parta
remove the comments; they aren’t necessar; forgot to clean it up!
parta=HumanoidRootPart
since the “VisalizationInstancesV2” folder will be placed directly inside the character; i am using script.Parent.Parent.Parent to get the player character
iteration
i am iterating through the model "VisualizeParts" and while iterating the if condition checks for if the object is not equal to script or the name of the object is not equal to "Root"
after that i am creating weld constrain and setting part0 property of that weld constraint to v(which is one of the part of under VisualizeParts)
next i am setting part1 property to RootPart(i am trying to weld all the parts inside the VisualizeParts to the part named Root)
finally i am placing the weld constraint inside v.
now that all the parts have been welded to the part named root, next
I am moving the whole model “VisualizeParts” to the position of parta(which is HumanoidRootPart of the character)
lastly i am setting the part0 propertyof weld constraint inside the root part “WeldConstraint2” to parta (you can set vice versa if you like, i just tested it)
"part0 to root and part1 to parta(humanoidrootpart)
To be honest you actually did solve my problem with attaching it to the player. I never even knew about weld constraints before… Thanks so much for your effort, i appreciate it so much