Posts

Showing posts from November, 2020

Web GL stuck loading at 90%

There's some sort of bug with the Web GL loader... disable the compression completely - Edit - Project Settings - Player - Publishing Settings, and change compression format from Whatever, to disabled

2 Bone IK in Unity

EDIT - I think.. it is best to have a standard FK hierarchy and multiple Rig Builders, which each exist one bone above the root of each 2 joint IK chain. Eg. the clavicle would have the rig builder and the L_HAND in my example below would sit underneath it. |- CLAVICLE  |     | -SHOULDER |     |     |   -ELBOW |     |     |     | -HAND |    |-runtime rig, containing the 2 bone IK & rig components  This hierarchy allows the clavicle to rotate and behave as it should in "standard" rigs. ------------------------------------------------------------------------------------------------------------------     At time of writing, Trump just got beaten by Biden! Good times.... and Unity 2020 has an "in preview" rigging package, which lets us implement simple IK setups. Now there are some third party commercial plugins we could look at - Final IK is probably the top dog at the moment.. Fast IK is free and actually quite good (BUT, for ME, the scripts caused build errors. I

UI in VR / XR

Remember to use the XR version of the Canvas UI -  it comes with the necessary components for it to interact with your VR controllers.  Also double check your Event System and delete the "StandaloneInputModule" if there is one already. According to the manual, it could disrupt the VR controllers from doing their thing.

combining png file textures and the Streaming Assets folder

Below is some code that takes whatever pngs you put in the Streaming Assets folder, puts them all into one texture and assigns them to a File Texture  input for a Visual FX graph. Certain things like resolution have been hardcoded into this script, so you might want to alter those numbers. You'll want to use the flipbook image so that each image can be used seperately (or not), as sprites. This should work with normal particles as well, if altered a bit.     using System.Collections; using System.Collections.Generic; using UnityEngine; using System.IO; using UnityEngine.UI; using UnityEngine.Networking; using UnityEngine.VFX; using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; public class multiTextureScan : MonoBehaviour {     public VisualEffect _visualEffect;     public Dictionary<string, Texture2D> textures = new Dictionary<string, Texture2D>();     // Source textures.     public Texture2D[] textureShop;     // Rectangles for individual atlas te