###前提・実現したいこと
Unityでstageというタグのオブジェクトに、
このスクリプトがアタッチされているオブジェクトが衝突した場所の
座標を求めてそこにプレファブを生成したいです。
###発生している問題・エラーメッセージ
Assets/ink.cs(13,44): error CS1061: Type UnityEngine.Component' does not contain a definition for
contacts' and no extension method contacts' of type
UnityEngine.Component' could be found. Are you missing an assembly reference?
###該当のソースコード
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ink : MonoBehaviour {
public GameObject inkato;
void Start() { } void OnCollisionEnter (Collision col) { if (col.gameObject.tag=("stage")) { foreach (ContactPoint point in collider.contacts) { GameObject ink = GameObject.Instantiate (bullet)as GameObject; inkato.transform.position = (Vector3)point.point; } } }
}
###試したこと
###補足情報(言語/FW/ツール等のバージョンなど)
言語はUnityのC#です。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。