Created
June 22, 2016 04:09
-
-
Save mattatz/bde200017c1eb27d60bba51474b5c4e6 to your computer and use it in GitHub Desktop.
FBXモデルのrootにhelperオブジェクトが置いてある場合に発生する回転のバグを修正するやつ.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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