概要
unity5.2の作法、調べてみた。
sceneを作る
file-new scene
cameraとlightが出来る。
3dオブジェクトを配置
gameobject-3dobject-sphele
球ができる。
位置を変更
transform-xを-10にする。
重力を効かせる
addcomponent-physics-rigidbody
ゲームを起動
三角ボタンを押す。
ゲームを停止
三角ボタンを押す。
床を設置
gameobject-3dobject-plane
広げる
scale -x,y,zを10,10,10にする。
名前をつける
sphereをtamaにする。
スクリプトを書く
assets-create-c#script
tamaにする。
using System.Collections;
public class tama : MonoBehaviour
{
void Start()
{
Rigidbody rigid;
Vector3 d = new Vector3(10, 10, 0);
rigid = this.GetComponent<Rigidbody>();
rigid.AddForce(d, ForceMode.Impulse);
}
void Update()
{
}
}
スクリプトを適用する。
addcomponent-scripts-tama
gif化した。
以上。