Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mimisukemaster/belt-conveyor-system
System of Belt-Conveyor with Unity / Rigidbodyを用いたベルトコンベヤーの物理的なシミュレーション
https://github.com/mimisukemaster/belt-conveyor-system
belt-conveyor unity unity-scripts unity3d
Last synced: about 1 month ago
JSON representation
System of Belt-Conveyor with Unity / Rigidbodyを用いたベルトコンベヤーの物理的なシミュレーション
- Host: GitHub
- URL: https://github.com/mimisukemaster/belt-conveyor-system
- Owner: mimisukeMaster
- Created: 2021-03-29T14:56:52.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-04-21T13:02:28.000Z (almost 4 years ago)
- Last Synced: 2024-11-15T18:12:30.376Z (3 months ago)
- Topics: belt-conveyor, unity, unity-scripts, unity3d
- Language: C#
- Homepage:
- Size: 889 KB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Belt-Conveyor-System
### > Made with Unity-version:2019.4.20f(LTS)
## unityでのinspectorの操作について
**[注意1]Scene上で複製する際、TransformのRotateを変えても、上に置かれたものの動く方向は変わりません。**
- 例えばBeltconveyorを4つに複製して、四角状に配置した場合(Picture1)
- そのまま特に設定せずにプレイすると、上の青いCubeは異なるBeltConveyorに乗り移っても同じ方向に移動を続けてしまいます。(Gif1)
#### Picture1

#### Gif1

- これは上側のBeltConveyorが、乗る物体の動く方向をスクリプトで決めていて、**ワールド座標のZ軸**に対してどの向き(前後左右(`forward`,`back`,`left`,`right`))に動かすかを指定しているため、角度をずらすとワールド座標上のZ軸の方向とBeltConveyorの見た目上の前方向がずれる(ローカル座標上のZ軸の向きが変わる)ことにより生じるものです。
- → 対処法として、初めに、それぞれのHierarchy内の`BeltConveyor`の中に含まれる`Onbelt`オブジェクト(上の物体が載るところのオブジェクト)を選択します。(**Picture2**)
次にinspectorにてアタッチされている`BeltConveyorSimple`コンポーネントの`Chosen Vec`パラメータを選択し、表示された向きの選択肢を、***そのBeltConveyorの上にある物体が運ばれる方向の、ワールド座標Z軸から見た向き***に合わせた選択肢にします。(Picture3)
#### Picture2

#### Picture3
今回のような四角状に配置した場合、真上から全体を見るとPicture4のようになります。
右上にある軸を見て分かる通り、Z軸は写真上の上側です。よって`1`の`BeltConveyor`の`ChosenVec`をZ軸に対して正の向きに動かしたいので`forward`を選択します。
同様にして`2`の`BeltConveyor`の`ChosenVec`はZ軸に対して右側に動かしたいので`right`を選択し、`3`のはZ軸に対して負の向きに動かしたいので`back`を、`4`のはZ軸に対して左側に動かしたいので`left`を選択します。(Picture5)
- 以上の設定を行うとGif2のような正しい挙動になります。
#### Picture4

#### Picture5

#### Gif2
**[注意2]Scene内での下側のBeltConveyorのObject(GameObject名:UnderBelt)は_「^(緑の矢印)」マークが逆になるため、ConveyorSimple.csのReverseパラメータにチェックを入れてください**
- 入れなくてもエラーが起こる訳ではありませんが、見た目が変になります。施す前と後で比較します:
#### Before (Picture6)in PlayMode,Gif3
- [ ] Reverse

#### After (Picture7)in PlayMode,Gif4
- [x] Reverse

## 取り込み上の注意
ZIP形式でDLした後、**Unity**に取り込んだ際に多少のエラーが出てくる場合があるかもしれません。(**Picture8**)
正常通り再生できるのであれば問題いりませんが、万が一再生を阻止されエラーの修正を促されたり、明らかなバグ(画像情報がないなど)があれば、
*GitHub Desktop* を開いて`File-> Clone repository` を選択し、この*repository*を**Clone**して取り込んでください。
#### Picture8
