Hi. My code is below.
what i’m trying to do here is just completely disable all automatic-rotation behaviour by unity. I want all my objects to be imported as-is, with zero rotation on all axes. I figured the simplest way to do this would just be to overwrite the value in postprocessor after unity is done screwing up my models.
It fails to compile with the following error:
Assets/Editor/CustomImportSettings.cs(13,38): error CS1041: Identifier expected
So basically this is a newbie question, what have i done wrong with the formattng ? I’m new to editor scripting and not entirely sure what’s expected here, i just copied a function from this page: Unity - Scripting API: AssetPostprocessor.OnPostprocessModel(GameObject) and modified it slightly
using UnityEngine;
using UnityEditor;
using System;
public class CustomImportSettings : AssetPostprocessor
{
public const float importScale= 1.0f;
void OnPreprocessModel()
{
ModelImporter importer = assetImporter as ModelImporter;
importer.globalScale = importScale;
}
function OnPostprocessModel (g : GameObject)
{
g.transform.rotation = new Vector3(0, 0, 0);
}
}