#red light green light problem

1 messages · Page 1 of 1 (latest)

valid mountain
#

i cant manage to get the head to be like the doll should

#

the script makes the head go like that for some reason

hollow garden
#

Maybe you're rotating on the wrong axis? Could I see your code?

valid mountain
#

ok

#

i will

#

idk if you can send me the finished version

#

*fixed

slate swan
# valid mountain i cant manage to get the head to be like the doll should

you get the offset from torso to head
local offset = Head.Position - pos

and than apply a rotation to the torso's position

than you add the offset back , but the offset is in the world space , not local to the roatted coorindate system

anyways to fix it , replace the getHeadCFrame fucntion with this

local function getHeadCFrame(yawOffset)
    local torsoPosition = Torso.Position
    local headOffset = Head.Position - torsoPosition
    local yaw = Torso.Orientation.Y + yawOffset
    
    local rotatedCFrame = CFrame.new(torsoPosition) * CFrame.Angles(0, math.rad(yaw), 0)
    
    local rotatedOffset = rotatedCFrame:VectorToWorldSpace(
        CFrame.new(torsoPosition):inverse():VectorToWorldSpace(headOffset)
    )
    
    return CFrame.new(torsoPosition + rotatedOffset) * CFrame.Angles(0, math.rad(yaw), 0)
end

more simply , you can replace it with this

local function getHeadCFrame(yawOffset)
    local torsoPosition = Torso.Position
    local yaw = Torso.Orientation.Y + yawOffset
    
    local headOffset = Head.Position - torsoPosition
    local rotationCFrame = CFrame.Angles(0, math.rad(yawOffset), 0)
    local rotatedOffset = rotationCFrame:VectorToWorldSpace(headOffset)
    
    return CFrame.new(torsoPosition + rotatedOffset) * CFrame.Angles(0, math.rad(yaw), 0)
end
#

TO FIND THE FUNCTION USE " CTRL + F " THAN PUT " local function getHeadCFrame" , THAN REPLACE IT TO THE
end

valid mountain
#

not fixed

#

can you make it a whole script?

#

its really dificult for me

#

@slate swan

#

heres my script

slate swan
#

here u go

#

try this and let me know

valid mountain
#

the same

#

it don change

#

@slate swan

slate swan
#

try this one

valid mountain
#

still same

#

@slate swan

slate swan
#

same , or no improvments ?

valid mountain
#

same

#

@slate swan

copper saddleBOT
#

studio** You are now Level 5! **studio

valid mountain
#

sadly

slate swan
#

try this

valid mountain
#

man youve been cursed or sm

#

why does rblx studio hate u

slate swan
#

its not roblox what hates me , its models ... i dont like models

valid mountain
#

Do i give u the model

#

so you can see

slate swan
#

i have no time to test models right now

valid mountain
#

its a free model

#

but oki

valid mountain
ancient summit
valid mountain
#

IM TWEAKING

ancient summit
#

did you try to rotate it manually

valid mountain
#

fym

#

im here tweaking

valid mountain
#

yes i did

ancient summit
#

and is it also being this weird