はなちるのマイノート

Unityをメインとした技術ブログ。自分らしくまったりやっていきたいと思いますー!

【Unity】Texture '...' is not readable, the texture memory can not be accessed from scripts. というエラーの対処法

はじめに

Texture2Dをスクリプトで取得しようとしたところ

Texture '...' is not readable, the texture memory can not be accessed from scripts. You can make the texture readable in the Texture Import Settings.

というエラーが出てきました。

テクスチャを読みとりできないというエラーなのですが、その解決方法を見つけたので書き残しておきたいと思います。

対処法

対象のテクスチャのインスペクターから、以下の画像にあるRead/Write Enabledにチェックを入れると読みとり・書き込み可能になります。

f:id:hanaaaaaachiru:20190917224050p:plain

この状態でApplyを押して適応すればOKです。