Quantcast
Channel: Latest Questions by username132323232

Getting references to children objects.

0
0
I'm working on a 2D game that will show several cars with 2-3 text signs on each car (license plates, company names,...). I'm going to have a prefab with the car sprite and the text signs as children. Now, the text sighs should be updated periodically, so I need to get references to them inside the script. What is best practice in accessing the text signs from the prefab instance?

Weird texture stretching problem.

0
0
I'm making a 2D game and struggling with a weird problem with using texture on a quad. The actual scenario is more involved, but I was able to reduce it to these simple steps: 1. Create a 512x512 background .png image and drop it into the Assets folder. A sprite texture is created. 2. Create a quad and set its size to 30x30x1. 3. Drop the sprite texture into the quad Inspector area. Now the image is displayed on the quad. 4. Add offset 0.2 to the texture. The image shifts by 20% and wraps inside the quad. **So far so good. The weird part follows.** 5. Go to the image import settings, change format to Truecolor and hit "Apply". Now part of the image is lost. It seems that a one-pixel column is **stretched**. 6. Try to go back to format Compressed and observe that the image is **still distorted**. I'm new to Unity, so please let me know am I doing something wrong or is it a bug? ![alt text][1] [1]: /storage/temp/37920-texture_question.png

"Compiling Please Wait" for over 10 seconds.

0
0
After changing even one line of C# code in MonoDevelop, it takes Unity about 10 seconds to recompile my project. I understand that this is probably normal because the project is pretty large at this point. So, my questions are: 1) Is it possible to find which files take most time to compile? 2) Is there a way to speed up the compilation process by making Unity compile only the files that change since the last compile or by any other methods short of buying a new computer?

Standalone Frame Rate.

0
0
When building a PC standalone, is there some place to specify target frame rate? The reason why I'm asking this is because I noticed that while in the Editor, my game's FPS fluctuates between 90 and 130, but in the standalone it's almost exactly 60.

A thin line on the edge of a quad.

0
0
Hello. For a 2D game scrolling background, I use a quad with a texture. The texture image is exactly 2048x512. For some reason when the texture is applied to the quad, there is very thin line that I can't get rid off no matter what! Here are the relevant screenshots, but please feel free to request more details if necessary. ![alt text][1] ![alt text][2] [1]: /storage/temp/40436-line-artifact.png [2]: /storage/temp/40437-line-artifact-2.png

Placing Several Buttons Inside a Panel.

0
0
I'm trying to place several(3 to 5) buttons on a UI panel. They should be located equidistantly, as shown below. The layout should adjust automatically if a small number of buttons are added or deleted. Button width and height should not change. ![alt text][1] I tried different variations of Layout Groups and Elements, but the best I came up is this: ![alt text][2] What am I missing? [1]: /storage/temp/40606-layout.png [2]: /storage/temp/40607-layout-actual.png

How to Turn off LZMA compression?

0
0
LZMA compression is great, but slows down development Web Player builds. Is it possible to temporarily turn it off? ![alt text][1] [1]: /storage/temp/40647-lzma.png

AddListener to a Toggle.

0
0
Hello. I would like to attach a listener to checkbox: void Start () { GameObject cb1 = (GameObject)Instantiate(cbPrefab); Toggle t = cb1.GetComponent(); t.onValueChanged.AddListener(() => handleCheckbox(value)); **error here** } void handleCheckbox(bool value) { print("handleCheckbox. value=" + value); } The compile error that I get is: error CS1593: Delegate `UnityEngine.Events.UnityAction' does not take `0' arguments Could somebody help me to fix this? Thanks!

Debugging inside web player.

0
0
My game works fine inside the Editor, but not in Unity web player. The error messages that web player displays are not very helpful: ![alt text][1] Is there a way to get more information about web player exceptions? [1]: /storage/temp/41424-webplayer-debug.png

WebGL build gets stuck.

0
0
To try WebGL build on Unity 5, I created a simple project with a scene that only has a camera. The build doesn't go beyond `"convert and compile scripting files"` Anybody else has this issue?

Dialog box positioning.

0
0
I would like a dialog box to: - take up 30% of the game width - be centered - preserve its aspect ratio Does anyone have an example of how this can be achieved with uGUI regardless of the game dimensions and aspect ratio around 16:9? Thanks!

Keyboard-controlled dialog box.

0
0
If a game is running on a desktop without a mouse, how can I select and press a button in a dialog box that has two or more buttons? Is there any sample code or an Asset Store plugin that would do that? Thank you.

iOS: anti-aliasing causes exc_bad_access exception.

0
0
Hello. I'm getting an exc_bad_access exception in iOS when anti-aliasing is turned on. The exception happens in UnityBlitToBackBuffer. Does anybody know how to fix that without turning anti-aliasing off? Thanks.

Can't debug an iOS game.

0
0
Hello. I'm trying to debug a game in iOS. When I attempt to attach the MonoDevelop debugger, it shows "Could not connect to the debugger" message. I use a develop build and the Profiler works fine. So it seems that the iPad communicates well with the desktop. So why the debugger won't connect? ![alt text][1] ![alt text][2] [1]: /storage/temp/49547-attach.png [2]: /storage/temp/49548-error.png

Animator Scripting Tutorial.

0
0
I'm trying to follow this lesson, but I can't locate the assets used in it. Are they available anywhere? http://unity3d.com/learn/tutorials/modules/beginner/animation/animator-scripting

Possible to delete unneeded presets from Game View?

0
0
Is it possible to delete unneeded presets from the Resolutions selector in the Game View?

Draw Calls Not Reduced After Adding Texture Atlas.

0
0
I'm working on a simple mobile 2D game. Currently there are 20 draw calls. To minimize the draw calls number, I put all the graphics into a Texture Atlas using the Sprite Packer. I expected a reduction down to about 5 draw calls. Surprisingly, I'm **not seeing any decrease in the number of draw calls**. I tried to replicate this scenario in a clean project and everything works as expected. So, this is probably not a Unity bug, but rather something in my original project that is preventing Unity from optimizing the number of draw calls. Any suggestions how to fix that?

Texture atlases and materials don't mix?

0
0
Is it possible to use an image from a texture atlas in a material? If not, why?

Can't Set Particle System TextureSheetAnimationModule.

0
0
I would like to set Particle System TextureSheetAnimationModule.rowIndex. Here's the code based on Unity reference (https://docs.unity3d.com/ScriptReference/ParticleSystem.TextureSheetAnimationModule-rowIndex.html): ParticleSystem ps = particleEffect.GetComponent(); ParticleSystem.TextureSheetAnimationModule tex = ps.textureSheetAnimation; tex.rowIndex = 2; It doesn't work and generates this error: NullReferenceException: Do not create your own module instances, get them from a ParticleSystem instance UnityEngine.ParticleSystem+TextureSheetAnimationModule.set_rowIndex (Int32 value) Am I doing something wrong or is Unity reference out of date? I have Unity 5.5.2f1.

Google app signing

0
0
Has anyone been able to update an existing app on Google Play after enrolling in Google app signing program? I have *private_key.pem* and *upload_cert.der* from Google, but how do I add them to a Unity keystore?
Please note that my question is not about Android app signing in general (that's very straightforward), but specifically about using the upload key (or certificate) received from Google.




Latest Images