Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I change bodypart rotation?

How can I change bodypart(Head,Torso,Left/Right Arm/Leg) rotation without the joint falling off. Though I am not too sure on how to start.

local Player = script.Parent.Parent
local Mouse = Player:GetMouse()

function onKeyDown(key)
	key = key:lower()
	if key == "f" then
		Player.Character.RightArm.Rotation--whenever I change the rotation to any value when the character is unanchored.  RightArm falls off.
	end
end
Mouse.KeyDown:connect(onKeyDown)

1 comment

0

Its in a localscript in Starterpack

1 answer

You could do this using an animation, make an animation to change the rotation. Use ROBLOX's animation plugin Disable the other body parts except the Right Arm once you get it. (Watch some tutorials if you don't know how to use it.) Export your animation, then do this:

local Player = script.Parent.Parent
local Mouse = Player:GetMouse()

function onKeyDown(key)
    key = key:lower()
    if key == "f" then
local Animation = Instance.new("Animation")
local animTrack = game.Player.LocalPlayer.Character.Humanoid:LoadAnimation(Animation)
Animation.AnimationId = "http://www.roblox.com/asset?id=IDHere"
animTrack:Play()
    end
end
Mouse.KeyDown:connect(onKeyDown)

2 comments

0

Thanks but ROBLOX animation pluggin is messy, thats why I wanted to learn it this way.

0

I'll edit my answer if I find a way.

This discussion is preserved as it was. New answers, comments, and votes are closed.