Quantcast
Browsing latest articles
Browse All 90 View Live

PlayerPrefsX Question

This has been a huge help thus far, but I've become stuck with a bit of syntax in the storing arrays function. I get an error saying "No appropriate version of 'PlayerPrefsX.SetStringArray' for the...

View Article


BeginScrollView Location adjustment

What is the proper syntax for adding variables to adjust the location of a scrolling bar?Here is what I have so far, which works, but does not allow me to move it around the screen:scrollPosition =...

View Article


Stop the screen rotation animation in Unity iphone?

I've recently come to realize that no matter what orientation you set for the iphone, the animation of the screen flipping still plays when the phone is tilted past the 90degree mark. This is not to...

View Article

Having trouble with iPhoneUtils.PlayMovie

I've not yet been able to get a video to play on the iPhone, and I'm assuming it has something to do with the if statement encapsulating the PlayMovie command. My iPhoneStreamingAssets folder is next...

View Article

Screen position orientation flipping

I'm trying to create a glowing orb that follows a user's finger when pressed down. It works well, but the Y axis is flipped. I figure that the screen position for the ipod is flipped from what the...

View Article


Detect a tap versus standing touch on iPhone?

So far I've tried to run a for loop while detecting a touch, and call it a tap if under X loops and a touch for over. However, that did not work nearly as well as expected. Is there a built in way to...

View Article

Having trouble getting triggers to work with two moving cubes

The script I have here is attached to the falling cube, and is using a Sphere collider with trigger unmarked. It is attached to a prefab that is instantiated above the screen and dropped into the...

View Article

Check how many objects are in a trigger?

As the title says, I'm trying to get a quick reading of how many objects are in a trigger. Is there any quick way to do this?

View Article


audio.PlayOneShot() not responding consistently on iPhone builds

I have a click sound that plays when you touch a button, and this works perfectly in Unity. However, on and iPod it only emits sounds sporadically. I'll touch a button once and it will click, then come...

View Article


Image may be NSFW.
Clik here to view.

How to avoid lighting seams with connecting geometry?

I'm working on creating a tileable set of hallways with Maya, and on import to Unity I find that the seams are very apparent when snapping pieces together. How can I force the lighting to work with two...

View Article

Why is this giving me an error? (ToBuiltin problems)

I'm not quite sure what's happening here. I'm getting the error "InvalidCastException: Cannot cast from source type to destination type." However, I can't see anything wrong. Here is the code: var locX...

View Article

string.search() in Unity Javascript?

I'm trying to get a count of the number of instances of a char in a string.Is there any way to get this to work in Unity's JS?var amtOfXinString : int = stringToSearch.search("x");

View Article

While Loop crashing Unity consistently

I'd like this function to lerp from 0 to 1 and then exit, as opposed to running for a single frame then exiting. As you can see, I've tried wrapping Mathf.Lerp in a while() loop. However, this...

View Article


Create an array of gameobjects in trigger?

I'm trying to create an array and keep it updated based on what objects are currently in a trigger. Here is what I have so far, the problem is that I am getting a null reference error when sending...

View Article

Variable creation through Inspector using CustomEditor?

I'm working on a utility for an upcoming project, and I'm delving into the world of editor programming. I'm having trouble figuring out how to write a script that will allow the user to set a number of...

View Article


How to use Editor Styles?

I'm trying to get the same effect as the small button in the Unity inspector, but to no avail. Here's what I've got:EditorGUIUtility.LookLikeInspector(); if(GUILayout.Button("+", radioButton) ) { //...

View Article

Image may be NSFW.
Clik here to view.

Custom Inspector Element on Texture Importer?

I'm trying to get a custom editor to show up in the inspector for textures. If I use@CustomEditor(TextureImporter) it overwrites the Texture Importer settings. How would I go about attaching this to...

View Article


The name 'List' does not denote a valid type ('not found')?

I declare my List like this: var sprites : List.<Texture2D> = new List.<Texture2D>();Which I'm almost positive is correct. However I get the error "The name 'List' does not denote a valid...

View Article

Set MinWidth for EditorWindow

Is it possible to set a minimum window width for an editor window? If so, how would I go about doing it?

View Article

Best Android Test Device?

I'm looking for a generic Android OS phone for testing apps. Is there a standard or will I need to purchase a couple of devices?

View Article

Time.deltaTime in Editor script

I've come to realize that Time.deltaTime does not update in an editor script. I need a timed countdown in this particular script. Is there any way to achieve this in editor?

View Article


Texture2D.format and TextureFormat.ARGB32 aren't comparable?

I'm trying to make sure that an image loaded into a game is of the ARGB32 format, but I can't seem to get Unity to compare the two. Code: if(image.format == TextureFormat.ARGB32) { // Stuff } This...

View Article


Custom Editor - Cast target as GameObject?

I'm trying to access the MeshRenderer component from a Custom Editor, but I can't seem to figure out the syntax in C#. In JS what I'm trying to accomplish: var mat : Material =...

View Article

Add Color Property to Unlit Alpha?

I'm attempting to add a Color field to the existing Unlit/Transparent shader. Here is what I have so far (Compiles, but does not actually modify the color): Shader "Custom/Unlit Transparent Color" {...

View Article

Set Vertices to Ground

I'm trying to set all the vertices of plane to match the height of the terrain. At the moment, it sets about half the plane to some random Y value and ignores the other half. I can't seem to figure out...

View Article


Making Duplicate Terrain Unique?

I need the ability to make a duplicate terrain unique, so that I may edit it's terrainData without affecting the original terrain. I found this question...

View Article

Open ObjectSelector window from Editor Script

I'm trying to replicate the Material ObjectField seen in the Inspector, except that I also want to view the material modifications to the texture. I've got everything working except for the Select...

View Article

Workaround for broken [PostProcessScene]

Pretty much what the title says. The PostProcessScene attribute works properly in editor, and debug logs say that it is fired during build sequences, but no changes to the scene ever make it to the...

View Article

Prevent implicit cast from Vector3-Vector2

Unity provides implicit casts between most of the Vector classes. This is nice in most situations, but is making debugging a nightmare for some of my code. I wrote conversion methods that accept an...

View Article



Rename a folder via code

I need to rename a folder at compile time. Specifically, as part of a build script. I've tried renaming with the command line then force re-importing assets as well as using an editor script with...

View Article
Browsing latest articles
Browse All 90 View Live