Does Static batching on 2D sprites work with random color tone?
Hello, I am not too familiar with static batching in unity. My understanding is, if the gameobjects with 2D sprites are marked as static meaning they dont move, scale or rotate in game unity will use...
View ArticleAvoid button touches to be registered as swipe.
using UnityEngine; using System.Collections; public class TouchEventManager : MonoBehaviour { public float MinimumSwipeDist; public float ThresholdAngle; public delegate void GestureEventHandler();...
View ArticleSprites are stretched after packing with sprite packer
I am using Unity 5.1.0 Personal edition. I am seeing some artifacts after packing my sprites using Unity's Sprite Packer. Here are two screenshots that show the artifacts in my sprites. Lot of space is...
View ArticleOverlapCircleAll vs BoxCollider2D performance
I have a gameObject that has some child gameObjects and in total 3-4 box colliders. The colliders in child gameObjects trigger OnTriggerEnter2D on the parent. I tried setting a flag when the child...
View ArticleHow to make cars rotate towards a waypoint while turning?
I have cars in my 2D game that have a rigidbody2D and box collider 2D. I was translating/rotating them using their transform and I recently found that you should not move gameObjects having colliders...
View ArticleiOS build crashes when trying to access WebCamTexture.videoRotationAngle
using UnityEngine; using System.Collections; public class SelfieScreen : MonoBehaviour { private CanvasRenderer m_renderer; private WebCamTexture m_selfie; private WebCamDevice [] m_webCamDevices;...
View ArticleHow do apps post on walls without the actual login flow?
Some games like Crossy roads bring up the share dialog from facebook without actually ever having to redirect to fb app for permissions. How is this possible? Also how can you get the native iOS dialog...
View ArticlePrefab structuring for compound colliders and animations.
I have a prefab for vehicle that moves with AI in the game with the following structure: - Empty GameObj Parent (component to move the car with AI) - model (the 3d model of car) - collider (this...
View Articlecrossy road style character selection screen.
I am creating a character selection screen using Scroll Rect. I was looking at how crossy roads does it. First off I noticed that the selected character scales up and does not scroll when you move the...
View ArticleCant locate iphone in debugger
I recently upgraded to Unity 5.3.1 Personal Edition. I can no longer located my iphone connected to my laptop and running my game in the debugger "Attach to Process" option. It only displays the Unity...
View ArticleAnchored Positions of horizontal layout element children not set during Start...
I am trying to read the values of anchored positions for children of a horizontal layout element in the Start function of a script. But the anchored positions are not set when my code tries to read...
View ArticleCant find UnityEngine.Analytics namespace in 5.3.0 personal edition.
I can't seem to be able to find Analytics after upgrading to 5.3.0. I can see UnityEngine.Advertisements. Do I need to do anything for Analytics to show up in Monodevelop?
View ArticleCannot set pivot for children of horizontal layout.
I have a horizontal layout and the children of the layout have the pivot set to upper left. When i select all of them and try to set their pivot to middle/center by using the shift key, they are set...
View ArticleIf Parent gameobject has DontDestroyOnLoad does it apply to its children?
If I have an empty gameobject and its marked as DontDestoryOnLoad. Now if I add child gameobjects to this empty parent dynamically in code as I instantiate the children, then are the children also...
View ArticleConcurrent coroutines working on same datastructure hang unity!
I have a list of gameobjects that represent the nodes of snake character in my game. I have 2 coroutines, one that adds more nodes to this list, and one that pulls all the nodes towards the head node...
View ArticleUnable to convert classes into dex format.
I am seeing the following errors when I am trying to build for android. I made sure I dont have any duplicate jar's in my project. I am posting the error log below. Please let me know if you need more...
View ArticleShader float value weirdness
Shader "Shader Tuts/Lambert" { Properties { _Color ("Color", Color) = (1.0,1.0,1.0,1.0) _MainTex ("Main Tex", 2D) = "white" {} _BumpMap ("Bump Map", 2D) = "bump" {} _BumpDepth ("Bump Depth",...
View ArticleWhy so many SetPass Calls?
I have 40 car objects in the scene all using the same material and texture. Each car model has 4 child wheel mesh models that use the same material and texture. When I have 1 car in the scene it says...
View ArticleIssues with rotation at 180 degrees
void FixedUpdate() { if(m_wayPoints != null) { if(m_rigidBody.position != m_targetWaypoint.position) { Vector3 newDir = Vector3.RotateTowards(m_rigidBody.transform.forward, m_targetDirection,...
View ArticleProfiling and clearing memory
I am currently profiling my game and trying to do some memory management. I have a lot of objects in my game that are memory pooled during the loading of the level. When I don't need objects they are...
View ArticleUnloading a prefab using Resources.UnloadUnusedAssets.
When I try and unload a prefab loaded using the Resources.Load(), I get an error saying gameobjects cannot be unloaded using Resources.UnloadAsset(). So the other way to do it was destory the instances...
View ArticleSave customized changes to prefabs at runtime.
I have few characters in my game that the player can customize with new accessories and changing some properties on the characters like color etc. Now these characters are saved as prefab instances in...
View ArticleIntegrating fastJson into unity
I am integrating the latest version of [fastJson][1]. When I imported all the scripts I got an error about System.Data not being referenced. So I copied the System.Data.dll from the...
View ArticleSerializing a dictionary to json using LitJson.
In my game players can customize their characters by changing the characters color and accessory. So I am trying to save this customization data as a Json to a text file. Here is my code: using...
View ArticleWhats the best way to detect unique downloads of my app through Unity Analytics?
How can I detect fresh downloads/installs of my app using Unity Analytics? My game does not have any server support and is solely client based. If any particular user deletes my app and re-installs it...
View ArticleGame lags on iPhone in low power mode.
My game runs smoothly at 30 fps when my iphone is in normal battery mode but starts to lag a lot when I put it in low power mode. Has anyone seen a huge difference in performance. Also I wanted to know...
View ArticleGetting the right sprite texel to screen pixle ratio with iphone 6 as base...
I am working on a 2D game and trying to get the resolution for my 2D sprites right. I am using iPhone 6 as my base resolution which is 750 x 1334. My orthographic camera has a size of 30, so vertically...
View ArticleSoomla store build problem.
I cloned Soomla's unity3d-store project from[Github][1] and was following their setup instructions. We are required to: - Clone this repository recursively: git clone --recursive...
View ArticleIncorrect RectTransform width value when trying to read child RectTransform...
public RectTransform cellContainer; private int m_numCells; private float m_leftScrollLimit; private float m_rightScrollLimit; private List m_cellRects; private HorizontalLayoutGroup...
View ArticleTime.unscaledDeltaTime behavior different on Android and iOS, when app...
I have a timer running inside a Coroutine that uses Time.unscaledDeltaTime. When I background the app the coroutine is paused. But Time.unscaledDeltaTime is still counting in the background on Android....
View Article