オブジェクトをクリックした時に半透明になって
隣のオブジェクトをクリックした時半透明のオブジェクト
と位置を交換するスプリクト
を書きたいのですがうまくいきません
半透明のスプリクトはうまくいきましたが
それ以外ができないんです
###試したこと
rayでオブジェクトの情報を取得(なぜかできなかったけど)
元のコード
using UnityEngine; using UnityEngine.EventSystems; public class CapsuleS : MonoBehaviour, IPointerClickHandler { public Material M; public Material MC; public void OnPointerClick(PointerEventData eventData) { this.GetComponent<Renderer>().material = MC; } void Update() { if (Input.GetMouseButtonDown(0)) { this.GetComponent<Renderer>().material = M; } Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); } }
###ゲームのイメージ
立体の3マッチパズル
あなたの回答
tips
プレビュー