提示画像にもある通りボックスコライダーを自分で微調整しても実行画面ではコリジョンを追尾してくれず。待機モーションや攻撃モーション
移動中でもこのまま位置が固定で追尾されてしまうため困っています。これはどうすればいいのでしょうか?
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Weapon : MonoBehaviour { private bool isEnemy; public bool EnemyCol { get{return isEnemy;} } // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } private void OnTriggerEnter(Collider other) { if(other.gameObject.tag == "Enemy") { isEnemy = true; }else{ isEnemy = false; } } }
現象だけでなく、オブジェクトの親子関係やソースコードも記載してください。
以下のページも参考になると思います。
https://teratail.com/help/question-tips
修正しました。
回答1件
あなたの回答
tips
プレビュー