[過去ログ]
【3Dゲームエンジン】Unity質問スレッド17 [転載禁止]©2ch.net (1001レス)
【3Dゲームエンジン】Unity質問スレッド17 [転載禁止]©2ch.net http://peace.5ch.net/test/read.cgi/gamedev/1429413414/
上
下
前次
1-
新
通常表示
512バイト分割
レス栞
抽出解除
レス栞
このスレッドは過去ログ倉庫に格納されています。
次スレ検索
歴削→次スレ
栞削→次スレ
過去ログメニュー
961: 名前は開発中のものです。 [sage] 2015/06/12(金) 18:01:24.03 ID:ESSmrvBP >>959 > ,smoothTime*Time.deltaTime); これの意図がイマイチ判らん 5.0f/Time.deltaTime になるわけだけどdeltaTimeは前フレームからの経過時間だから 補間の係数Tに使えるものじゃなくね fixedupdateで安定したのは試してないけど定期的に呼ばれるからdeltaTimeのブレがなくて 変な数値で固定できていたからでは? そもそもどういう挙動を意図してるかどうかわからんけど、それをアルゴリズム化できていないという コーディング能力の問題じゃないですかねこれ http://peace.5ch.net/test/read.cgi/gamedev/1429413414/961
962: 名前は開発中のものです。 [] 2015/06/12(金) 18:15:26.45 ID:yT7Nup/Q >>961 キャラクター側 private Rigidbody rigid; private int sppedForce = 10; public float maxSpeed = 20; private GameObject player; // Use this for initialization void Start () { //start Start rigid = GetComponent<Rigidbody>(); player = GameObject.FindWithTag ("Player"); //end Start } void FixedUpdate() { //start FixedUpdate if(rigid.velocity.magnitude<maxSpeed && !Input.GetKey("space") )rigid.AddForce(transform.forward*sppedForce); //end FixedUpdate } void Update () { //start Update float smoothTime = 5f; Vector3 wantedVector; wantedVector = player.transform.position-transform.position;/*操作できるやつ= new Vector3(Input.GetAxis ("Horizontal"),0,1);*/ Quaternion wantedRotation = Quaternion.LookRotation(wantedVector); //transform.rotation = Quaternion.Slerp(transform.rotation,wantedRotation,smoothTime * Time.deltaTime); transform.rotation = Quaternion.Lerp(transform.rotation,wantedRotation,smoothTime * Time.deltaTime); //end Update } 公式のsmoothCameraを参考にしていましたがおかしかったのですか。 全オブジェクトのUpdateのあとにLateUpdateが呼び出されるのでfreeCameraをLateで呼び出せばいいんですよね。 http://peace.5ch.net/test/read.cgi/gamedev/1429413414/962
メモ帳
(0/65535文字)
上
下
前次
1-
新
書
関
写
板
覧
索
設
栞
歴
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.049s