22
votes
Unity Method count exceed the limit of 64K
This answer relies heavily on Android's official documentation (the quoted parts, specifically).
How to setup Multidex Support for Unity Project
What is Multidex:
Android application (APK) files ...
6
votes
Accepted
Update and FixedUpdate together
Update Order
When you’re keeping track of game logic and interactions, animations, camera positions, etc., there are a few different events you can use. The common pattern is to perform most tasks ...
5
votes
Accepted
Minigame inside game in Unity
You can load a scene without destroying anything in the current scene by using the method SceneManager.LoadScene with the ...
5
votes
How to move a object to a target point like sine wave in 2D world
I'm going to explain as much as I can to avoid more questions.
Let's begin from the simple linear motion. It's something like:
...
5
votes
Converting UnityScript code to C#: What is the alternative for .ToBuiltin?
In Unity's JavaScript implementation (sometimes called UnityScript), there are two types of array: JavaScript-style arrays, which have no particular type or length, and "Builtin" (native ....
5
votes
Accepted
C# invoke stops unity
The label and goto in your FixedUpdate method is an infinite loop equivilent to:
...
5
votes
Accepted
Random Range Without Duplicates
Common approach
Shuffle your array. A simple Fisher–Yates shuffle will do. The result is that you will have your array of GameObject in a random order.
When ...
4
votes
Accepted
How do I use coroutines to animate properly?
Calling yield break breaks the coroutine and the while loop in it won't start over again. The while loop goes through only once after waiting for 0.3 seconds. Use ...
4
votes
Unity Random.Range not repeat same position
In general, if you do not want randoms throwing the same value twice, you implement a Shuffle Bag.
Here's the idea:
Generate every possible outcome and store them in a list.
Remove from list ...
4
votes
Insert 3d text to the front face of a cube GameObject
I think understand this question well enough to answer it and a year old (old questions deserve some love too).
Simply adding the TextMesh component to the cube is insufficient, as the text mesh has ...
4
votes
Accepted
Unity RectTransformUtility.ScreenPointToLocalPointInRectangle
Preface
This question starts with a small geometry problem. You have two different planes which may or may not be parallel.
1) Your screen space. This is the actual screen coordinates your computer ...
4
votes
Accepted
is GameObject.Find() a bad idea even for one frame?
The GameObject.Find() function sure is heavy, but it doesn't mean your game will run slow if you use it even once. The idea is that it's better to get reference of ...
4
votes
Accepted
unity job system for 2d or more dimmension arrays?
Just flatten the 2d array into a 1d array by concatenating the rows. So a 2d array like this:
11111
22222
33333
becomes a 1d array like this:
...
3
votes
Accepted
C# Script file is not showing in Onclick Event in Unity 5.0.4f1?
You need to add the LevelLoader script to the LevelLoader object in the hierarchy panel. Then drag the entire LevelLoader object (not script) from the hierarchy ...
3
votes
Unity bowling pins detection
Here's an example similar to how I detected domino tipping in Last One Standing.
...
2
votes
For each array within array using UnityScript
Generally in javascript, you use for...in for objects. For arrays, you can use forEach. Like ...
2
votes
How to compress Unity apk output?
You can use Tinypng to decrease you graphics size without visible graphics quality damage, Decreasing graphics size ultimatly leads to decrease in apk size.
Make spritessheets either using Texture ...
2
votes
Accepted
Why I have to press the button twice to deactivate the GameObject for the first time?
At the Start() you're setting the variable settings_menu to false, then you're checking whether that variable is false or not. ...
2
votes
Update and FixedUpdate together
They are actually all running at the same time, your scripts just do stuff in those functions. Update is called once per frame and FixedUpdate is called once every "physics update" (which is once ...
2
votes
Accepted
Optimizing data structure for my text adventure?
I strongly recommend making your own file format that optimizes viewing and editing of the text parts.
Get rid of redundancy to reduce errors while editing.
You'll also want to get rid of numeric ...
2
votes
How to implement jump in NavMesh?
Why it is not working
As you said, the function is called as soon as you hit Space. That's why it doesn't work because isKinematic is then instantly reset to ...
2
votes
How to always land a square box in 90 degree
If you have a fixed speed:
If you know the starting speed (the speed you launch the box at) and the gravity, then the time the square spends in the air is v / g, ...
2
votes
How can I make car respawn with temporary invulnerability i.e. no collisions?
Thanks to DMGregory!!
I Change the layer, I make that layer 10 and 9 not collision, but if the 10 collides with itself:
...
2
votes
Accepted
How can I get the vector3's names to gameobject name?
While there is a way to get the name of a variable in C# (I do not recommend this), you'd still have to perform that stringification before calling ...
2
votes
How can I get the vector3's names to gameobject name?
As Draco18s mentioned, with your current code you'll need to get the string before calling SpawnLineGenerator(). If you're using C# 6, the ...
2
votes
Accepted
How can I make the objects to move at the same speed as the lines?
I think what you probably want to do is move your object first, then move the line to meet it:
...
2
votes
Accepted
Unity Player Movement Problem
The problem is in this line:
transform.position = move * speed * time.deltatime;
If the value of move*speed*Time.DeltaTime is ...
2
votes
is GameObject.Find() a bad idea even for one frame?
When you use Find only once when the scene loads, then performance is unlikely to be an issue. You would have to do that for quite a lot of objects to get a notable increase in scene load time.
But ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
unityscript × 319unity × 295
c# × 85
2d × 24
javascript × 17
android × 12
raycasting × 9
physics × 8
movement × 8
gui × 8
scripting × 8
animation × 7
collision-detection × 6
unity-networking × 6
java × 5
3d × 5
game-design × 5
camera × 5
ai × 4
visual-studio × 4
navmesh × 4
procedural-generation × 3
gameobject × 3
text × 3
frame-rate × 3