Not allowed to access uv4 on mesh 'Cylinder' (isReadable is false; Read/Write must be…
- User
Not allowed to access uv4 on mesh 'Cylinder' (isReadable is false; Read/Write must be enabled in import settings) UnityEngine.Mesh:SetUVs (int,System.Collections.Generic.List`1<UnityEngine.Vector3>) Outline:LoadSmoothNormals () (at Assets/QuickOutline/Scripts/Outline.cs:195) Outline:Awake () (at Assets/QuickOutline/Scripts/Outline.cs:96) UnityEngine.Events.UnityEvent:Invoke () ScenarioStepBase:Run () (at Assets/Scripts/Scenario/ScenarioStepBase.cs:37) InteractScenarioStep:Run () (at Assets/Scripts/Scenario/InteractScenarioStep.cs:18) Scenario:NextStep () (at Assets/Scripts/Scenario/Scenario.cs:89) Scenario:OnStepFinished () (at Assets/Scripts/Scenario/Scenario.cs:95) UnityEngine.Events.UnityEvent:Invoke () ScenarioStepBase:Finish () (at Assets/Scripts/Scenario/ScenarioStepBase.cs:61) InteractScenarioStep:Finish () (at Assets/Scripts/Scenario/InteractScenarioStep.cs:37) InteractableObject:Interact () (at Assets/Scripts/Interaction/InteractableObject.cs:11) VRInteractableObject:OnDetachedFromHand (Valve.VR.InteractionSystem.Hand) (at Assets/Scripts/Interaction/VRInteractableObject.cs:144) Valve.VR.InteractionSystem.Hand:DetachObject (UnityEngine.GameObject,bool) (at Assets/SteamVR/InteractionSystem/Core/Scripts/Hand.cs:671) VRInteractableObject:HandAttachedUpdate (Valve.VR.InteractionSystem.Hand) (at Assets/Scripts/Interaction/VRInteractableObject.cs:158) Valve.VR.InteractionSystem.Hand:Update () (at Assets/SteamVR/InteractionSystem/Core/Scripts/Hand.cs:1107)
- Assistant
The error message you are seeing is indicating that the
Meshcomponent of the GameObject named "Cylinder" in your Unity project has theisReadableproperty set tofalseand you are trying to access its UVs. WhenisReadableis set tofalse, you cannot read or modify mesh data at runtime.This is a common issue when working with meshes in Unity and it usually stems from the mesh import settings. Unity allows you to disable read/write access to mesh data to save memory, but this also means you cannot access or modify the mesh at runtime if you do so.
Here's how you can fix this issue:
-
Go to the "Project" tab in the Unity Editor and locate the mesh asset (usually with a
.fbxor.objextension) that is being used for the "Cylinder" GameObject. -
Select the mesh asset to view its import settings in the "Inspector" tab.
-
In the "Model" section of the import settings, find the "Mesh" subsection.
-
There should be an option that says "Read/Write Enabled". Make sure that this option is checked—this allows the mesh data to be accessed and modified at runtime.
-
Click the "Apply" button at the bottom of the "Inspector" tab to save the changes.
After doing the steps above, the
isReadableflag should set totrueand the mesh data can be read or modified at runtime. This should resolve the error and allow theOutlinescript to access the UVs as intended.It's important to remember that enabling read/write on meshes can increase the memory usage of your application, as the mesh data needs to be stored in a way that is accessible to the CPU. Only enable it for meshes that actually need to be manipulated at runtime.
-