Until now, I never understood what I should rotate so that the accessory rotates by script. How do I do that?
Example of what an accessory is made up of:
Do you mean rotate to fit properly, or rotate to spin?
Rotate only the accessory without the head also rotating
you could try editing the weld properties of the accesory weld
I had already thought about this, the problem is that I never managed to get it to work via script. how do I do?
i have no idea
i would try help but i dont have roblox studio on this computer so
I’m going to put one of the attempts I made previously:
char:FindFirstChild(AccessoryName*).Handle.AccessoryWeld.C0 = CFrame.Angles(math.rad(0),math.rad(90),math.rad(0))
Note: AccessoryName was obtained through a remote event that matches the name of the target accessory
so
char:FindFirstChild(AccessoryName*).Handle.AccessoryWeld.C0 = CFrame.Angles(math.rad(0),math.rad(90),math.rad(0))
?
could be something to do with the “*” cause i’ve never heard of it being used in scripts
“*” was just used as a note I wrote below. it doesn’t exist in the actual script.
oh
could you show errors that came out from the output?
there are no errors, i will show the problem by video:
robloxapp-20230907-2304308.wmv (1.2 MB)
it ends up rotating the first time, the problem is that if I do it a second, third, etc., it doesn’t rotate anymore
try adding the math rad instead of setting it
Can you give an example (sorry, I’m not thinking clearly as I practically had to code several lines all day long.)?
Well, I probably won’t get an answer from anyone else, I should be able to solve the problem tomorrow.
I recommend that if you are planning to create an accessory rotation system, to create a variable of the original accessory’s position so you can use it as an offset when rotating your accessory. Here’s a sample script:
local AccessoryWeld = game.Players.LocalPlayer.Character:FindFirstChild("Hat name here").Handle.AccessoryWeld --Change the "Hat name here" to your accessory's name.
local Old_C0 = AccessoryWeld.C0 --Our weld's original rotation and position.
AccessoryWeld.C0 = Old_C0 * CFrame.Angles(0, math.rad(180), 0) --We use our old hat's position to get the original offset and add a 180 degree to it using math.rad().
Sorry I’m only responding now. Thanks for the help, now I know how to rotate accessories
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.