Get it on Google Play


Wm뮤 :: '분류 전체보기' 카테고리의 글 목록 (19 Page)

블로그 이미지
가끔 그림그리거나 3D모델링하거나
취미로 로봇만드는
퇴직한 전자과 게임프로그래머
2020.3.48f1 , 2022.3.6f1 주로 사용
모카쨩
@Ahzkwid

Recent Comment

Archive


'전체보기'에 해당되는 글 1020건

  1. 2023.08.12 VRChat 레이어
  2. 2023.08.12 다이나믹본 설정
  3. 2023.08.12 포톤 기초
  4. 2023.08.11 유니티 Final IK
  5. 2023.07.25 윈폼 오류 모음
  6. 2023.07.16 유니티 NavMesh
  7. 2023.07.10 사람들이 선호하는 조준선
  8. 2023.07.09 VRChat VCC OpenProjet 안 될때
2023. 8. 12. 21:37 게임/VRChat

 

 

 

2019/06/02 기준

'게임 > VRChat' 카테고리의 다른 글

Booth 구매 방법  (0) 2024.01.02
VRChat VCC OpenProjet 안 될때  (0) 2023.07.09
Booth 선물 방법  (0) 2023.04.14
posted by 모카쨩
2023. 8. 12. 21:18 Unity

루트본 설정할때 흰색선으로 나타나는 본을 확인하면서 맞추자


damping 탄성값, 젤리같은거 설정할때 낮출수록 좋음, 높을수록 스프링처럼 튀는거를 방지
elasticity 탄력값, 변형으로부터 얼마나 빨리 돌아올지
stffness 단단함, 관성에 얼마나 영향을 받을지,0으로 하면 움직여도 제자리
inert 둔한, 얼마나 늦게 반응할지 인듯? 아니면 다이나믹을 얼마나 적용할지일듯

 

 

 

 

옷, 헤어 등

 

 

가슴

 

 

꼬리

'Unity' 카테고리의 다른 글

ugui에 3d 넣기  (0) 2023.08.13
유니티 Final IK  (0) 2023.08.11
유니티 NavMesh  (0) 2023.07.16
posted by 모카쨩
2023. 8. 12. 18:50 Unity/Photon

 

 

 

또 오랫동안 안 쓰니 자꾸 까먹는다

기초를 까먹어서 나중에 찾는데 안 보임 ㅋㅋ;;

 

 

 

Photon Transform View

포톤판 ObjectSync이다

상위에 Photon View 있어야 함

 

'Unity > Photon' 카테고리의 다른 글

자주 쓰는 유니티 포톤챗 코드  (0) 2021.12.14
포톤 오류,에러 모음  (0) 2021.12.08
포톤 친구랑 같이 플레이  (0) 2021.11.24
posted by 모카쨩
2023. 8. 11. 05:11 Unity



 

 

브챗하면서 썼던 파이널 IK

오랜만에 다시 쓰려고 하니 기억이 안난다

그래서 정리

 

 

 

 

 

 

이건 좀 구형인데 이렇게 하고 타겟을 움직이면 따라간다

 

 

 

 

 

말그대로 Arm IK

Target으로 이동한다

유감스럽게도 아래의 Aim IK랑 동시적용은 안 된다

 

 

 

 

 

Aim IK

총구를 해당 장소에 향하게 할때 쓴다

근데 Aim IK를 쓰면 ParentConstraint가 먹통이 되니 주의

스크립트를 별도로 만들어서 연결시키는거보단 그냥 아마추어 하위에 프리팹 넣어주는게 더 간편할듯

 

Aim Transform은 총구 방향

Ribs는 체스트

Target은 쳐다보는 방향이다

스파인도 있으면 스파인도 넣어주는게 좋다

 

 

 

 

 

 

 

weight 조정

여기 올라간건 구버전이라 코드엔 안 나와있는데

애니메이션이랑 동시에 껐다 켰다 하면

일시적으로 에임 포인트가 차렷기준으로 잡혀서 허리가 돌아가 버린다

반드시 애니메이션을 먼저 키고 그 뒤 IK를 키고

끌때도 IK를 먼거 끄고 애니메이션을 끄자

var aimIK = animator.GetComponent<RootMotion.FinalIK.AimIK>();

var weight = 0f;
var lerpSpeed = 8f*Time.deltaTime;
if (GetWeaponSystem().weaponIndex == 2)
{
}
else
{
    if (attack)
    {
        if (Vector3.Distance(chest.transform.position, crosshair.HitPoint) > 1)
        {
            weight = 1;
        }
    }
    else
    {
        var nowTime = Time.time;
        var delay = 1;
        if (nowTime < weaponSlots[weaponSlotIndex].lastFireTime + delay)
        {
            weight = 1;
        }
        lerpSpeed = 4f * Time.deltaTime;
    }
}
if (GetComponent<PhotonCharacter>().hp <= 0)
{
    weight = 0;
    lerpSpeed = 1;
}
aimIK.solver.IKPositionWeight = Mathf.Lerp(aimIK.solver.IKPositionWeight, weight, lerpSpeed);

 

 

 

'Unity' 카테고리의 다른 글

다이나믹본 설정  (0) 2023.08.12
유니티 NavMesh  (0) 2023.07.16
유니티 애니메이션 관련  (0) 2023.04.03
posted by 모카쨩
2023. 7. 25. 09:18 윈도우폼

 

 

 

 

------------------------------------------------------------------------------------------------------------------------------

모든 차트 영역 요소의 위치를 계산하기 전에는 PositionToValue 메서드를 호출할 수 없습니다

PositionToValue method cannot be called prior to calculating position of all chart area elements.

 

 

MouseMove 이벤트중에 PixelPositionToValue를 호출해서 발생했는데

아래와 같이 HitTest를 먼저 진행해서 하면 해결된다

var result = chart.HitTest(e.X, e.Y);
if (result.ChartArea != null)
{
    var xValue = chartArea.AxisX.PixelPositionToValue(e.X);
}

 

 

 

------------------------------------------------------------------------------------------------------------------------------

System.ArgumentException: '이름이 '차트이름'인 차트 요소를 'SeriesCollection'에서 찾을 수 없습니다.'

chart.ChartAreas[0].CursorX.SetCursorPixelPosition(mousePosition, true);

할때 발생했는데 이거도 역시 이벤트 충돌로 인해 발생한 결과로 다음과 같이 수정했다


//X커서 표시(실수)
{
    var x = mousePosition.X;
    x = Math.Max(0, x);
    x = Math.Min(x, chart.Width);
    double xValue = chart.ChartAreas[0].AxisX.PixelPositionToValue(x);
    chart.ChartAreas[0].CursorX.Position = xValue;
    position = chart.ChartAreas[0].CursorX.Position;
}

 

 

 

 

 

 

 

 

 

 

 

 

'윈도우폼' 카테고리의 다른 글

윈도우용 대화형 프로그램 설정  (0) 2023.09.26
C# 환경변수 설정  (0) 2022.02.16
잘 안 쓰는 윈폼코드 모음  (0) 2021.07.19
posted by 모카쨩
2023. 7. 16. 20:00 Unity

 

 

 

길이 가져오기

도달했나 검사할때 씀

remainingDistance가 잘 안작동 해서 만듦

public static float GetPathLength(NavMeshPath path)
{
    float length = 0f;

    if ((path.status != NavMeshPathStatus.PathInvalid) && (path.corners!=null))
    {
        for (int i = 1; i < path.corners.Length; ++i)
        {
            length += Vector3.Distance(path.corners[i - 1], path.corners[i]);
        }
    }
    else
    {
        length = 99999f;
    }

    return length;
}

 

 

 

디버깅용

V1

if (Application.platform==RuntimePlatform.WindowsEditor)
{
    if ((path!=null)
        && (path.status != NavMeshPathStatus.PathInvalid) 
        && (path.corners != null))
    {
        for (int i = 0; i < path.corners.Length - 1; i++)
        {
            Debug.DrawLine(path.corners[i], path.corners[i + 1], Color.green);
        }
    }
}

 

V2

#if UNITY_EDITOR
void OnDrawGizmos()
{
    var agent = GetComponent<NavMeshAgent>();
    if (agent == null)
    {
        UnityEditor.Handles.Label(transform.position, "agent == null");
        return;
    }
    //var path = agent.path;
    if (path == null)
    {
        UnityEditor.Handles.Label(transform.position, "path == null");
        return;
    }
    if (path.status == NavMeshPathStatus.PathInvalid)
    {
        UnityEditor.Handles.Label(transform.position, "path.status == NavMeshPathStatus.PathInvalid");
        return;
    }
    if (path.corners == null)
    {
        UnityEditor.Handles.Label(transform.position, "path.corners == null");
        return;
    }
    if (path.corners.Length < 2)
    {
        UnityEditor.Handles.Label(transform.position, "path.corners.Length < 2");
        return;
    }
    UnityEditor.Handles.Label(transform.position, $"path.corners.Length : {path.corners.Length}\npath.corners[1] : {path.corners[1]}");
    for (int i = 0; i < path.corners.Length - 1; i++)
    {
        Debug.DrawLine(path.corners[i], path.corners[i + 1], Color.green);
    }
    Gizmos.DrawWireSphere(transform.position, agent.stoppingDistance);
}
#endif

 

 

 

 

목적지 설정


public void SetDestination(Transform target)
{
    var agent = GetComponent<NavMeshAgent>();
    if ((target != null) && (agent != null))
    {
        agent.SetDestination(target.position);
    }
    else
    {
        agent.ResetPath();
    }
}

 

 

 

패스를 WASD로 변경



/// <summary>
/// x는 horizon (-1 ~ 1)
/// y는 height (Mathf.NegativeInfinity ~ Mathf.Infinity)
/// z는 vertical (-1 ~ 1)
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
Vector3 Path2WASD(NavMeshPath path)
{
    if (path == null)
    {
        return Vector3.zero;
    }
    if (path.status == NavMeshPathStatus.PathInvalid)
    {
        return Vector3.zero;
    }
    if (path.corners == null)
    {
        return Vector3.zero;
    }
    var agent = GetComponent<NavMeshAgent>();

    var stoppingDistance = 0.1f;
    if (agent!=null)
    {
        stoppingDistance = agent.stoppingDistance;
    }

    if (stoppingDistance > GetPathLength(path))
    {
        return Vector3.zero;
    }



    if (path.corners.Length<2)
    {
        return Vector3.zero;
    }

    var movePos = path.corners[1];


    if (path.corners.Length >= 3)
    {
        if (Vector3.Distance(path.corners[0], path.corners[1]) < 0.1f)
        {
            movePos = path.corners[2];
        }
    }
    Debug.DrawLine(transform.position + Vector3.up * 0.1f, movePos + Vector3.up * 0.1f, Color.blue);

    var relativePosition = Quaternion.Inverse(transform.rotation) * (movePos - transform.position);
    var relativePosition2D = new Vector2(relativePosition.x, relativePosition.z).normalized;
    relativePosition = new Vector3(relativePosition2D.x, relativePosition.y, relativePosition2D.y);

    Debug.DrawLine(transform.position + Vector3.up * 0.2f, transform.position + transform.rotation*relativePosition + Vector3.up * 0.2f, Color.red);
    return relativePosition;
}

 

'Unity' 카테고리의 다른 글

유니티 Final IK  (0) 2023.08.11
유니티 애니메이션 관련  (0) 2023.04.03
구글플레이 앱 이전  (0) 2023.03.06
posted by 모카쨩
2023. 7. 10. 15:54 게임분석

 

 

 

 

가운데가 빈 십자조준선

 

 

점 조준선

 

 

초록색이 잘 보여서 초록색을 선호하나 디자인이 예쁘지 않으므로 흰색이 좋을듯

 

초록색이 선호되는 이유는 적 색상이 빨간색이기 때문에

적원추세포를 자극하지 않음으로서 학습 및 처리시간을 단축할수 있는 녹색이 선호되는 모양

 

다만 배그같이 배경에 녹색이 많은경우 적색을 선호한다

 

 

'게임분석' 카테고리의 다른 글

진압방패 모음  (0) 2023.09.03
FPS 관련 자료  (0) 2023.08.21
과금 정책 자료  (0) 2021.12.24
posted by 모카쨩
2023. 7. 9. 17:40 게임/VRChat

다음처럼 Opening만 뜨고 안 열릴때

 

 

 

UnityHub를 연다

 

 

 

 

 

'게임 > VRChat' 카테고리의 다른 글

VRChat 레이어  (0) 2023.08.12
Booth 선물 방법  (0) 2023.04.14
자주 쓰는 USharp 코드  (0) 2023.01.22
posted by 모카쨩

  • total
  • today
  • yesterday

Recent Post

저사양 유저용 블로그 진입