Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How can I change bodypart rotation?

Asked by 9 years ago

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)
0
Its in a localscript in Starterpack GianniKun 40 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

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)
0
Thanks but ROBLOX animation pluggin is messy, thats why I wanted to learn it this way. GianniKun 40 — 9y
0
I'll edit my answer if I find a way. Grenaderade 525 — 9y
Ad

Answer this question