Posts

Showing posts from April, 2020

Unity: VR Head Blocking (Steam VR v2)

Image
Fade color can be changed or disabled to produce a pure wall push back effect on impact. VRHeadBlocking.cs: // VR Head Blocking Script (Synaptic Response) // For use with SteamVR Unity Plugin v2 // Attach to Player -> FollowHead -> HeadCollider and set Tag to "Player" // Initial Implementation: Scott Lupton (04.18.2020) using System.Collections; using System.Collections.Generic; using UnityEngine; using Valve.VR; public class VRHeadBlocking : MonoBehaviour { public GameObject player; [SerializeField] bool fadeEnabled = true ; [SerializeField] Color fadeColor = Color.black; private int layerMask; private Collider[] objs = new Collider[ 10 ]; private Vector3 prevHeadPos; private int fadeState = 0 ; private float fadeDuration = . 5f ; private float internalFadeTimer = 0f ; private float backupCap = . 2f ; private void Start () { ...

Unity: Creating a VR Canvas Based HUD

Image
Creating a VR Canvas Based HUD in Unity: This ensures no clipping through world objects by using a second UI camera 1) Create a Canvas object and set the Render Mode to "World Space" 2) Duplicate your VR Camera (under Player->SteamVRObjects->VRCamera) 3) Name this "UICamera" and make it a child of "VRCamera" 4) Unselect "UI" from the VRCamera culling mask 5) Unselect everything but "UI" from the UICamera culling mask 6) Set Clear Flags to "Depth only" and Depth to 1 (higher number than in VRCamera) in UICamera 7) Select "UICamera" as your canvas event camera

UE4: Publishing to the Unreal Marketplace

Image
1) Register as a publisher from:  http://publish.unrealengine.com 2) Create an empty UE4 project (select Game --> Empty Project) 3) Create a uniquely named folder in the content root of the project, and add the assets you want to distribute 4) If you like, also lay out your assets on the example level, save that in the same folder, and set it as the default game and editor level in the product settings 5) After closing down the project, delete the following folders manually: \Binaries \Build \Intermediate \Saved \Content\Collections \Content\Developers 6) Zip the project and host it somewhere online. 7) Submit a request to publish the asset from  http://publish.unrealengine.com