ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

Unity's Survival Shooter tutorial with HTC Vive

unity

htc vive

virtual reality

Автор: Roland C

Загружено: 2016-12-31

Просмотров: 8631

Описание: Update 2017-08-09: TheStoneFox did an official tutorial including teleporting, which is awesome. You should check it out. Here's the link:

   • VRTK v3 - [Intermediate] Unity Survival Sh...  

Original:
---------------------------
Quick convert of Unity's Survival Shooter tutorial to in Virtual Reality.

The whole learning and conversion process took around 2 hours of time. VRTK is awesome.

Also, the ZomBunny, ZomBear and Hellephant look great in VR, the video here can't show that :D

Used software:

VRTK (Virtual Reality ToolKit)
https://github.com/thestonefox/VRTK

Unity 5.5
https://unity3d.com/get-unity/download

Survival Shooter
https://www.assetstore.unity3d.com/en...

Steps for the conversion in case anyone wants to do it themselves:

import survival shooter
import steamvr
import vrtk
load "Level 01 5.x"
drag camerarig into scene
reset transform
disable main camera
create [VRTK] empty gameobject
-- drop VRTK_SDKManager script on it
-- select "Steam VR" for System SDK and all other SDK
-- click "Auto Populate Linked Objects"
attach empty gameobject named "RightController" to [VRTK]
add scripts:
-- VRTK_Controller_Events
-- VRTK_Controller_Actions
-- VRTK_Interact_Touch
-- VRTK_Interact_Grab
-- VRTK_Interact_Use
-- VRTK_Interact_Auto_Grab
assign RightController gameobject to VRTK_SDK_Manager's "Script Alias Right Controller"
create Gun.cs, code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using VRTK;

public class Gun : VRTK_InteractableObject
{
protected override void Awake()
{
base.Awake();
}

public override void StartUsing(GameObject usingObject)
{
base.StartUsing(usingObject);
}

}
add Gun.cs to Gun gameobject and set:
is grabbable: true
valid drop: no drop
is usable: true
Gun gameobject:
add box collider to it and set:
Is Trigger: true
add VRTK_Child_Of_Controller_Grab_Attach
assign VRTK_Child_Of_Controller_Grab_Attach to Grabb Attach Mechanics (in that same gameobject, "Gun (Script)")
detach Gun from Player
-- reset transform
-- add empty gameobject GunSnapTransform
--- set Position 0.26 / 0.38 / 0.25 (note: needs proper adjustment, only for quick test)
set GunSnapTransform as Right Snap Handle in Gun gameobject
assign Gun gameobject to VRTK_Object_Auto_Grab -> Object To Grab
detach GunBarrelEnd from player and attach it to Gun
-- set position 0.281 / 0.41 / 0.972
-- set rotation 0.563 / 0 / 0
copy PlayerShooting.cs to PlayerShootingVR.cs (of course rename class name in code) and replace the script in GunBarrelEnd with it
-- add firing code

void Start()
{
VRTK_ControllerEvents events = VRTK_DeviceFinder.GetControllerRightHand().GetComponent<VRTK_ControllerEvents>();
events.TriggerPressed += FireGun;
}

private void FireGun(object sender, ControllerInteractionEventArgs e)
{
Shoot();
}

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Unity's Survival Shooter tutorial with HTC Vive

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

Build VR Multiplayer Games in Unity 6

Build VR Multiplayer Games in Unity 6

Unity против Unreal в 2024 году

Unity против Unreal в 2024 году

Would You Survive Zombie Apocalypse with This?

Would You Survive Zombie Apocalypse with This?

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]