
- SUFFICIENT VELOCITY ZOMBIE QUEST HOW TO
- SUFFICIENT VELOCITY ZOMBIE QUEST DRIVER
- SUFFICIENT VELOCITY ZOMBIE QUEST ARCHIVE
enabled = ! ragdoll // Switch the base collider animator.
In the Awake method, get localPosition and modelTransform from a zombie, save the start local coordinates of the zombie's child object, which will be ragdolled, so that we can return this child object to its original position when Ragdoll is finished.įor ( int i = 0 i (). Vector3 localPosition // modelTransform position of a zombie Transform modelTransform // used to process Ragdoll float standTime = 0, flyTime = 0 // time on the ground and in flight bool isOnGround = false // check whether the zombie is on the ground or not bool isFly = false // check whether the zombie is in flight or not bool isRagdoll = true // is Ragdoll on? bool canAttack = false, prevCanAttack = false // can a zombie attack? Player target // target for a zombie attack (player) Rigidbody rb Animator animator // used to control the animation of zombies Transform floorChecker // used to switch Ragdoll Public class ZombieController : MonoBehaviour The GameOver method initiates the execution of the Restart method, which restarts the game after a certain time and starts a new level. Note: The InvokeRepeating method cyclically calls the required method at regular time intervals. identity) // spawn zombies enemiesCount ++ one * randomSize // set the zombie size Instantiate( enemies, spawnPoints. Add the necessary fields: maximum number of spawned zombies, an array with enemies, an array with spawn points for zombies, restart time after the player's death and counter for spawned zombies. In this script, we'll describe the end and restart of our game and when the zombies appear. Create a new script and name it GameManager.cs. Don't forget to add the offset! Determining the Game Logic
Note: You can use not only leg joints but also all other skeleton joints detected by Nuitrack (21 joints all in all) (see the complete list at Nuitrack official website). You will also see the "screen" with the user's segment that helps to check FPS and understand whether the user's legs are in the frame or not. You should see your feet displayed as nice blue sneakers.
Drag-and-drop the script to the Player game object. Private void OnSuccessCalib( Quaternion rotation) An offset is a skeleton offset that is calculated based on the data received from VR Camera and Nuitrack (the rest of the skeleton joints). Inherit the NuitrackLegs class from TrackedUser, this will allow you to easily get the data of the Current User or user by the specified ID.Īdd the necessary fields. In this script, we'll define the skeleton tracking and create the player's legs. When you run the scene, NuitrackScripts automatically marked as DontDestroyOnLoad.Ĭreate a new script and name it NuitrackLegs.cs. The necessary components will be added to the scene. Prepare the scene for using Nuitrack in one click, to do this, click: Main menu -> Nuitrack -> Prepare the scene. And make it a child of the "Camera" object. To visualize calibration drag the CalibrationVisualization prefab to the scene: Assets → NuitrackSDK → NuitrackCalibrationRGB. SUFFICIENT VELOCITY ZOMBIE QUEST DRIVER
Then you need to add the component Tracked Pose Driver so that the camera can move and rotate after the player's head. Set its Position and Rotation to (0, 0, 0) so that the player is standing in the center of the scene (as he is the new hope of mankind in our game).
Creating an empty object, rename it to "VR Head". Enable Open XR support in XR Plug-in Management settings. Our zombie apocalypse begins in a developed megalopolis (New York? Who knows.). Open the scene "City" (Nuitrack SDK → Tutorials → Zombie Nightmare (VR) → City). SUFFICIENT VELOCITY ZOMBIE QUEST ARCHIVE
(If you want to see what happens right away, you can unpack the archive FinalAssets.zip to the Final Assets folder).
Unzip Tutorial Assets.zip in tutorial folder. Create a new project and name it as you wish (for example, “Incredible Zombie Game with Nuitrack”). You can find the finished project in Nuitrack SDK: Unity 3D → NuitrackSDK.unitypackage → Tutorials → Zombie Nightmare (VR). Depth sensor (see the list of supported cameras at our website). For example Oculus Meta Quest 2 (or Rift, Rift S, VALVE INDEX, or another 6DOF VR Headset)
You'll need just a couple of things for this project: but with his LEGS! Have you ever used your legs when playing with VR? We haven't! And now your wildest dreams come true thanks to Nuitrack! If a zombie takes a bite of a player, the player's health slightly decreases and eventually he can die :( So what is that bewitching little detail of that seemingly trivial project? The point is that the player has to destroy zombies not with his hands. The player has a limited number of lives.
The player's goal is to kill all zombies that randomly appear from everywhere. We'll create a VR game called "Zombie Nightmare".
SUFFICIENT VELOCITY ZOMBIE QUEST HOW TO
In this tutorial you'll learn how to create a super duper cool project using Oculus Meta Quest 2 (or Rift, Rift S, VALVE INDEX, or another 6DOF VR Headset) and Nuitrack.