OculusQuest技術

OculusQuestでゲームを作る話

未分類

近づき

投稿日:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;

public class NavUniControl : MonoBehaviour
{
public Transform goal;
private NavMeshAgent agent;
private Animator animator;
// Start is called before the first frame update
void Start()
{
agent = GetComponent();
agent.destination = goal.position;

    animator = GetComponent<Animator>();
}

// Update is called once per frame
void Update()
{
    agent.destination = goal.position;

    if (agent.remainingDistance < agent.stoppingDistance)
    {
        animator.SetBool("walk", false);
        agent.isStopped = true;
    }
    else if (agent.remainingDistance > agent.stoppingDistance + 0.5f)
    {
        animator.SetBool("walk", true);
        agent.isStopped = false;
    }
}

}

-未分類

執筆者:


comment

メールアドレスが公開されることはありません。

関連記事

no image

次のアイデア

次はどんなゲームにするか、大体の構想ができました。VRに関する本を読んでいたのですが、簡単に言うと「VRは体験するもの」という事が載っていました。 そうかもしれない と単純に思いました。というのも、私 …

no image

手を表示するには

CustomHandLeft,Rightをルートに設置し、ParentTransformにカメラリグのTrackingSpaceを設定する。

no image

テストの度にビルドするのめんどい2

VirtualDesktop、入れてみました。 結果・・・やっぱやめました。 理由はTouchコントローラーがうまく動かなかったこと。 残念ですが、またその都度ビルドしますね・・・

no image

やっぱりUnityに戻ります

Unreal Engine 4の勉強を進めていましたが、期待していたブループリントも面倒だった・・・それと根本的にやりたいことがVRなので情報量を考えるとやっぱりUnityの方がよいかもしれない。とい …

no image

次回作、路線少し変更

前回の試作版から大きく変更します。ストーリーの大枠は同じだけど、演出面とか、流れを変えます。イメージ的には同級生2のこずえパターンでいきます。 この動画の1:12:00あたりにこずえとの衝突演出があり …