#IDK

1 messages · Page 1 of 1 (latest)

lapis sandal
#
local function convertMoveToCameraSpace()
    local move = hum.MoveDirection
    if move.Magnitude == 0 then
        return Vector3.zero
    end
    
    
    move = Vector3.new(move.X, 0, move.Z)
    if move.Magnitude == 0 then
        return Vector3.zero
    end
    move = move.Unit
    
    local cam = workspace.CurrentCamera
    local cf = cam.CFrame

    
    local result =
        cf.RightVector * move.X +
        cf.LookVector  * move.Z

    return result.Unit
end

this is dynamic joystick movement for flying system

why do i move left when joystick is shifted to right
and vice versa

quick yachtBOT
#

studio** You are now Level 2! **studio

livid snow
lapis sandal
#

sometimes

high oyster
#

just do cam.CFrame *= put CFrame here

#

it'll already move in the camera space

#

🙏

#

oh wait u mean move to camera space

#

u do like

#

cam.CFrame:Inverse() * (the cframe u want to make it to local space of the cam)

#

basically like

#

the inverse will get the reverse of the matrix rotation and translation

#

and then put it to the cframe u wanna make it to local space and then it'll just unrotate that part that u wanna make it local space with the translation and then just get the original thingywingy position on how it look like if the camera is the local space or something