Destroy may not be called from edit modeの対処法
正確には
Destroy may not be called from edit mode! Use DestroyImmediate instead.
と表示されるはずです。
GameObject.DestroyメソッドはEdit modeで用いることができません。
なので、エラーの内容通りGameObject.DestroyImmediateメソッドを使ってやればいいのでした。
UnityでTessellation
TessellationはDirectX 11の機能らしいです。
詳しい説明はコチラで↓
「DirectX 11」のテッセレーション | NVIDIA
[Assets]->[Import packages]->[Effect]
インポートするだけで使用することができます。
使用するにはShaderの
- Tessellation
- Bumped Specular(displacement)
- Bumped Specular(smooth)
で使用することができます。
displacementがメッシュに凹凸をつけるもので、smoothがメッシュの表面を滑らかにするものです。
Unityでオブジェクトの移動にRoot motionを利用してみる
本日はUnityのRoot Motionを使ってみたいと思います。
Root Motionとは?
Unityの公式マニュアル
Unity - マニュアル: ルートモーションの仕組み
または、Unreal Engineの公式マニュアルが参考になりました
docs.unrealengine.com
実際に使ってみる
- CubeとAnimator、transformのpositionを変更するanimation clipを作る
- animationのGenerate Root Motion Curvesをクリック
- CubeのAnimatorのApply Root Motionのチェックを入れる
これで、Root Motionの設定は終わりです。