Остановка игрока после сбития
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
|
||||
public class HitDetectorScript : MonoBehaviour
|
||||
{
|
||||
@ -9,6 +10,7 @@ public class HitDetectorScript : MonoBehaviour
|
||||
|
||||
[SerializeField] private GameObject _Menu;
|
||||
[SerializeField] private GameObject _ForwardSource;
|
||||
[SerializeField] private ActionBasedContinuousMoveProvider move;
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
@ -29,6 +31,8 @@ public class HitDetectorScript : MonoBehaviour
|
||||
// Меню смотрит в том же направлении, что и источник, но фиксируется по вертикали
|
||||
Quaternion newRot = Quaternion.LookRotation(new Vector3(forward.x, 0, forward.z));
|
||||
|
||||
move.enabled = false;
|
||||
|
||||
// Создание объекта
|
||||
Instantiate(_Menu, newPos, newRot);
|
||||
|
||||
|
Reference in New Issue
Block a user