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

ハンドトラッキング対応完了?

腕を振ると移動するという仕組み作りました。 public class PlayerMove : MonoBehaviour { public GameObject CenterCamera; OVRI …

no image

トゥーン調のテスト

とりあえず、テストキャラを作ってみました。まあ、こんな感じでいいんじゃない?って具合にできました。テストなので実は左右の目の感じが違っていたりします。 何度も見てると妙な愛着が湧いたりするから、このま …

no image

RayでTrrigerを除外する

Project SettingsでPhysicsのQueries Hit Triggersのチェックを外す

no image

YouTubeVR

QuestでYouTubeを見てみた。まずはVRで「攻殻機動隊」の予告?があったので見てみたが、カメラワークの関係かすぐに酔いの症状に。これは使えない・・・次に普通の動画を見てみることに。なんと・・・ …

no image

Twitterを始めました

https://twitter.com/pixy50355681 Twitterを始めました。理由はUnrealEngineの勉強具合を残していくためです。ノウハウとかじゃなくて、どこまで学習したか記 …