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

つかんだものと自分を干渉させない

ものをつかんだまま遊んでいると自分のコライダーに当たってしまって自分が飛ばされることがありました。 解決方法はレイヤーで干渉させないようにして対策

no image

無線接続でビルド

VirtualDesktopでビルド無しで実行するがうまくいかず、結果的に無線でIPアドレスによってQuestに転送する方法で今はやっています。 ここのページを参考にしました。 https://qii …

no image

ハンドトラッキング超苦労した!

OculusIntegration 12.0が発表されてUnityでもハンドトラッキングの自作アプリを作れるようになったのですが、何しろ仕様を確認するのに一苦労。幸いネット上には色々な情報を流していた …

no image

トゥーン調カクカク原因は不明

シェーダーをMobileのunlitにすると、カクカクは無くなりスイスイ。となると原因はシェーダーなワケですが、UTS2でMobileを選んでも影の処理が重いのかもしれない。とは言え、今回のゲームはト …

no image

DynamicBoneで一部が揺れなかった件

DynamicBoneを仕込んでOculusQuestで見ると・・・なんと揺れない。 いろいろいじっていたらわかりました。 QualityのOtherでSkinWeightsを4Bonesに変更すると …