用途別リファレンス

・あたり判定をつける

Shotクラスのループ外に下記を打ち込む
  thit=0;

Shotクラスのループ内に下記を打ち込む
Shot

for(c in all(chara2)){ if(abs(ox-c.ox)<50 && abs(oy-c.oy)<50 && abs(z-c.z)<50){//あたり判定 c.hit = c.hit+1;//chara2のヒットカウントに1プラス thit = thit+1; } }

if(thit>=1){ break; }

chara2クラスループ外に
  hit=0;
chara2クラスループ内に
  if(hit >= 1){
        break;
    }

以上を打ち込むと弾とchara2がその場で停止する。

前 3D弾を打つ 次 3D背景

追加要素 力加減の判定方法