Unity, Torque3D, Google O3D, WebGl….which to choose? [closed]

WebGL is not a failure in the making. Speaking like it’s a failure shows these peoples ignorance. That said, if you’re just starting out, explore your options. If you’re looking for more eyes than just windows users, stay away from proprietary solutions. Microsoft’s dominance isn’t big as people think, anymore. IE is fading in popularity, … Read more

How to find child of a GameObject or the script attached to child GameObject via script

Finding child GameObject by index: You can get the first child of a GameObject with the GetChild function. GameObject originalGameObject = GameObject.Find(“MainObj”); GameObject child = originalGameObject.transform.GetChild(0).gameObject; You can get other children by providing index number of the child GameObject such as 1,2,3, to the GetChild function. and if its a child of a child in … Read more

How to scroll to a specific element in ScrollRect with Unity UI?

I am going to give you a code snippet of mine because I feel like being helpful. Hope this helps! protected ScrollRect scrollRect; protected RectTransform contentPanel; public void SnapTo(RectTransform target) { Canvas.ForceUpdateCanvases(); contentPanel.anchoredPosition = (Vector2)scrollRect.transform.InverseTransformPoint(contentPanel.position) – (Vector2)scrollRect.transform.InverseTransformPoint(target.position); }

Could not find manifest-merger.jar (com.android.tools.build:manifest-merger:26.0.1)

I finally fixed the issue. This may be a workaround but it works. So if anyone having this issue, just follow this: Swap the position of jcenter() and google() in project gradle file and in also all the other module you have in your project. Like in mine I have crashlytics, fabric so just remember … Read more

How to get a random number from a range, excluding some values

Since no-one has posted any example code: private int GiveMeANumber() { var exclude = new HashSet<int>() { 5, 7, 17, 23 }; var range = Enumerable.Range(1, 100).Where(i => !exclude.Contains(i)); var rand = new System.Random(); int index = rand.Next(0, 100 – exclude.Count); return range.ElementAt(index); } Here’s the thinking: Build a Hashset of numbers you want to … Read more

Unity singleton manager classes

Like always: it depends. I use singletons of both kinds, components attached to GameObject and standalone classes not derived from MonoBehaviour. IMO the overall question is how are instances bound to the lifcycle of scenes, game objects, … And not to forget sometimes it is more convenient to have a component especially referencing other MonoBehaviour … Read more