[過去ログ] 【海栗は】Unity 5スレ目【プリンと醤油で代用】 (926レス)
1-

このスレッドは過去ログ倉庫に格納されています。
次スレ検索 歴削→次スレ 栞削→次スレ 過去ログメニュー
67: 2011/09/12(月)00:30 ID:ytoeYGNZ(1/14) AAS
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);
}}
よく考えないままに作ってたらこんなターゲットからぶっ飛んでいくものができてしまった・・・
ターゲットに近づいていくものが作りたかったのに。
1-
あと 859 レスあります
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ AAサムネイル

ぬこの手 ぬこTOP 0.010s