.
This commit is contained in:
parent
362e56ee5f
commit
a80c2af23d
@ -18,6 +18,18 @@ public class RemoveBullet : MonoBehaviour
|
||||
if (coll.collider.CompareTag("BULLET"))
|
||||
{
|
||||
Destroy(coll.gameObject);
|
||||
|
||||
// 충돌 정보
|
||||
ContactPoint cp = coll.GetContact(0);
|
||||
// 충돌 지점(좌표)
|
||||
Vector3 pos = cp.point;
|
||||
// 충돌 지점의 법선 벡터
|
||||
Vector3 normal = -cp.normal;
|
||||
// 벡터를 Quaternion 타입으로 변환
|
||||
Quaternion rot = Quaternion.LookRotation(normal);
|
||||
|
||||
// 스파크 생성
|
||||
Instantiate(sparkEffect, pos, rot);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user