채팅0

    이거 좀 도와주실분?

    조회수 426

    -- 캐릭터 앞으로 이동하는 함수

    function MoveForward(distance)

    local player = GetMyCharacter() -- 현재 캐릭터 가져오기

    local currentPosition = player.GetPos() -- 현재 위치 가져오기

    -- 앞으로 이동할 위치 계산
    local forwardVector = player.GetForwardVector()
    local targetPosition = currentPosition + (forwardVector * distance)
    
    -- 이동 커맨드 생성
    local moveCommand = {
        type = "move",
        position = targetPosition
    }
    
    -- 이동 커맨드 실행
    player.ExecuteCommand(moveCommand)

    end


    -- 캐릭터 앞으로 1미터 이동

    MoveForward(1)

    댓글1

    회원프로필

    그냥 오핫써;

    2024.02.08 22:35

      게시글 리스트
      제목작성자작성일조회
      공지10-2022371
      6178712-24233
      6178612-23511
      6178512-22577
      6178412-22663
      6178312-22592
      6178212-21689
      6178112-21820
      6178012-21757
      6177912-19966
      6177812-181074
      6177712-181577
      6177612-161574
      6177512-141690
      6177412-142030
      6177312-141941
      6177212-131805
      6177112-132252
      6177012-122142
      6176912-112810
      안내 배너 이미지