【海栗は】Unity 5スレ目【プリンと醤油で代用】at GAMEDEV【海栗は】Unity 5スレ目【プリンと醤油で代用】 - 暇つぶし2ch■コピペモード□スレを通常表示□オプションモード□このスレッドのURL■項目テキスト67:名前は開発中のものです。 11/09/12 00:30:09.90 ytoeYGNZ.net using UnityEngine; using System; using System.Collections; public class enemijioTransform : MonoBehaviour { public Transform target; public float deg = 30.0f; float CosradZ=0.0f; float SinradZ=0.0f; void Update() { Vector3 relativePos = target.position - transform.position; Quaternion rotation = Quaternion.LookRotation(relativePos); transform.rotation = rotation; float deg=transform.rotation.y; float rad = deg * Mathf.Deg2Rad; Debug.Log(deg + "degrees are equal to " + rad + " radians."); Debug.Log("Mijioenemy X " + transform.position.x ); Debug.Log("Mijioenemy Z " + transform.position.z ); Mathf.Cos(rad); Debug.Log("Cos(rad) " + Mathf.Cos(rad)); Mathf.Sin(rad); Debug.Log("Sin(rad) " + Mathf.Sin(rad)); CosradZ=Mathf.Cos(rad); SinradZ=Mathf.Sin(rad); Transform t = transform; t.position += new Vector3(CosradZ, 0.0f, SinradZ); }} よく考えないままに作ってたらこんなターゲットからぶっ飛んでいくものができてしまった・・・ ターゲットに近づいていくものが作りたかったのに。 次ページ最新レス表示レスジャンプ類似スレ一覧スレッドの検索話題のニュースおまかせリストオプションしおりを挟むスレッドに書込スレッドの一覧暇つぶし2ch