naverz / zepeto-script-sample

38 stars 7 forks source link

런타임에 생성되는 제페토 캐릭터 OnCollisionEnter() #17

Closed jeejul1010 closed 2 years ago

jeejul1010 commented 2 years ago

runtime에 생성되는 제페토 캐릭터에 rigidbody와 collider가 이미 있나요? 플레이해보면 다른 오브젝트들과 부딪히는 것처럼 보이는데 OnCollisionEnter 충돌이 발생하지 않네요,, 대상 오브젝트에는 rigidbody와 collider 모두 있습니다. 제페토 캐릭터를 스크립트로만 접근할 수 있어서 _player.gameObject.AddComponent(); (MyPlayer는 제가 정의한 스크립트로 OnCollisionEnter()가 있습니다)와 _player.gameObject.AddComponent();를 시도해봤는데요 런타임때 생성되는 LocalPlayer object에 스크립트로 추가한 컴포넌트가 런타임에 생기는데 LocalPlayer는 제페토 캐릭터를 따라다니지 않더라구요 그래서 _player.zepetoPlayer.character.gameObject.AddComponent();로 해봤는데도 제페토 캐릭터를 조정해서 물체에 부딪혔을 때 충돌감지가 여전히 안되고 있습니다. 일반 오브젝트끼리는 OnCollisionEnter가 문제가 없는데 제가 놓치고 있는 부분이 있을까요? 도움주시면 감사하겠습니다 :)

jeejul1010 commented 2 years ago

런타임에 씬뷰에서 제페토 캐릭터를 이동하든 대상 오브젝트를 이동해서 제페토 캐릭터에 충돌시키면 충돌감지가 되는 것 같은데요 왜 가상 컨트롤러나 키보드로 제페토 캐릭터를 이동시켜 오브젝트에 부딪히게하면 충돌체크가 안되는걸까요?

moondory77-naverz commented 2 years ago

안녕하세요. 런타임에 생성되는 ZepetoCharacter 오브젝트는 Rigidbody, Collider가 아닌 CharacterController 컴포넌트를 통해 물리 이벤트를 처리하고 있습니다.

그렇기때문에 ZepetoCharacter 오브젝트에 스크립트를 추가하여 런타임 충돌이벤트를 수신할 경우, OnControllerColliderHit(ControllerColliderHit) 이벤트를 통해 충돌 감지를 처리해주세요.

jeejul1010 commented 2 years ago

감사합니다 :)

On Mon, Nov 8, 2021 at 1:53 PM moondory77-naverz @.***> wrote:

안녕하세요. 런타임에 생성되는 ZepetoCharacter 오브젝트는 Rigidbody, Collider가 아닌 CharacterController 컴포넌트를 통해 물리 이벤트를 처리하고 있습니다.

그렇기때문에 ZepetoCharacter 오브젝트에 스크립트를 추가하여 런타임 충돌이벤트를 수신할 경우, OnControllerColliderHit(ControllerColliderHit) 이벤트를 통해 충돌 감지를 처리해주세요.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/naverz/zepeto-script-sample/issues/17#issuecomment-962811552, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI4WHUIKCB2OQ2OLGK6IJ7DUK5JU7ANCNFSM5GZQKGCA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- hellokitty<3er