エラーコード
Assets\Scripts\PickupObject.cs(9,11): error CS0120: An object reference is required for the non-static field, method, or property 'Component.gameObject
C#
1using System.Collections; 2using System.Collections.Generic; 3using UnityEngine; 4 5public class PickupObject : MonoBehaviour 6{ 7 void OnTriggerEnter(Collider collider) 8 { 9 if(Collider.gameObject.tag == "Player") 10 { 11 print("Item pick up"); 12 Destroy(gameObject); 13 } 14 } 15}
しつもんはなんでしょうか
回答1件
あなたの回答
tips
プレビュー