2019/06/02 기준
'게임 > VRChat' 카테고리의 다른 글
Booth 구매 방법 (0) | 2024.01.02 |
---|---|
VRChat VCC OpenProjet 안 될때 (0) | 2023.07.09 |
Booth 선물 방법 (0) | 2023.04.14 |
2019/06/02 기준
Booth 구매 방법 (0) | 2024.01.02 |
---|---|
VRChat VCC OpenProjet 안 될때 (0) | 2023.07.09 |
Booth 선물 방법 (0) | 2023.04.14 |
루트본 설정할때 흰색선으로 나타나는 본을 확인하면서 맞추자
damping 탄성값, 젤리같은거 설정할때 낮출수록 좋음, 높을수록 스프링처럼 튀는거를 방지
elasticity 탄력값, 변형으로부터 얼마나 빨리 돌아올지
stffness 단단함, 관성에 얼마나 영향을 받을지,0으로 하면 움직여도 제자리
inert 둔한, 얼마나 늦게 반응할지 인듯? 아니면 다이나믹을 얼마나 적용할지일듯
옷, 헤어 등
가슴
꼬리
ugui에 3d 넣기 (0) | 2023.08.13 |
---|---|
유니티 Final IK (0) | 2023.08.11 |
유니티 NavMesh (0) | 2023.07.16 |
또 오랫동안 안 쓰니 자꾸 까먹는다
기초를 까먹어서 나중에 찾는데 안 보임 ㅋㅋ;;
Photon Transform View
포톤판 ObjectSync이다
상위에 Photon View 있어야 함
자주 쓰는 유니티 포톤챗 코드 (0) | 2021.12.14 |
---|---|
포톤 오류,에러 모음 (0) | 2021.12.08 |
포톤 친구랑 같이 플레이 (0) | 2021.11.24 |
브챗하면서 썼던 파이널 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);
다이나믹본 설정 (0) | 2023.08.12 |
---|---|
유니티 NavMesh (0) | 2023.07.16 |
유니티 애니메이션 관련 (0) | 2023.04.03 |
------------------------------------------------------------------------------------------------------------------------------
모든 차트 영역 요소의 위치를 계산하기 전에는 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 |
길이 가져오기
도달했나 검사할때 씀
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;
}
유니티 Final IK (0) | 2023.08.11 |
---|---|
유니티 애니메이션 관련 (0) | 2023.04.03 |
구글플레이 앱 이전 (0) | 2023.03.06 |
다음처럼 Opening만 뜨고 안 열릴때
UnityHub를 연다
끝
VRChat 레이어 (0) | 2023.08.12 |
---|---|
Booth 선물 방법 (0) | 2023.04.14 |
자주 쓰는 USharp 코드 (0) | 2023.01.22 |