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

Clothを使ってみる

UnityにはClothというのがあって、そのまま布をシミュレーションするものがあります。今度のゲームはClothを使って服を表現してみようかなと思っています。(リアリティが増すかなと思って)でもどう …

no image

しばらくBlenderの勉強します

今までキャラクターをVroidで作ってきたけど、やっぱりキャラクターのモデリングができないことにはやりたいことができない。しかし、過去に失敗している経緯あり。 Blenderでモデリング 今度はちゃん …

no image

VRの開発って・・・

ゲームを作ろうと技術研究しておりますが、じゃあゲームを作りましょうとなった時に 「3Dモデルってどうするの?」 ってなる。 結局、ステージを作るにもそれなりにノウハウが必要だし、キャラクターを・・・っ …

no image

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

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

no image

モデルをすり抜けない手3

モデルをすり抜けない手を作っていて、なんとかうまくいっていたのですが、デバックしてると引っ掛かりというか、滑らかに動かないんです。画面見せろという話になるかもしれませんが、まだ試作ですので・・・モデル …