Skip to content

Instantly share code, notes, and snippets.

@mattatz
Created June 22, 2016 04:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mattatz/bde200017c1eb27d60bba51474b5c4e6 to your computer and use it in GitHub Desktop.
Save mattatz/bde200017c1eb27d60bba51474b5c4e6 to your computer and use it in GitHub Desktop.
FBXモデルのrootにhelperオブジェクトが置いてある場合に発生する回転のバグを修正するやつ.
using UnityEngine;
using System.Collections;
namespace mattatz.Utils {
/*
* FBXモデルのrootにhelperオブジェクトが置いてある場合に発生する回転のバグを修正するやつ.
* rootオブジェクトをx軸に-90度回転させ,親オブジェクトを追加する.
* http://answers.unity3d.com/questions/13988/asset-import-from-3dsmax-rotation-issue.html
*/
public class FBXRotationHelper : MonoBehaviour {
void Start () {
var parent = new GameObject("FBX Helper");
parent.transform.position = transform.position;
transform.SetParent(parent.transform, false);
transform.localRotation = Quaternion.AngleAxis(-90f, Vector3.right);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment