Quantcast
Channel: Answers by "Flynn"
Browsing all 59 articles
Browse latest View live
↧

Answer by Flynn

function ammoPickedUp (ammoPickUp : int) { if (ammoMG <= 200){ ammoMG += ammoPickUp; } } Let's walk through this. If you have 199 bullets left, and you ask it to add ten, then first, it will check...

View Article


Answer by Flynn

rigidbody.isKinematic = true; Will cause your rigidbody to cease calculating. If you set it to true again, it will pick right back up where it left off :) So yes, isKinematic will pause your rigidbdy...

View Article


Answer by Flynn

1. Go to your project, and click create > new prefab 2. Drag the projectile you have in your heirarcy onto the new prefab 3. Rename the prefab as you like 4. Drag the prefab from the project folder...

View Article

Answer by Flynn

Unity gets confused when there is a folder named Assets in your project, you will need to rename it: Close the project, then click on Open Project, click the find button, and click on your project...

View Article

Answer by Flynn

You can do this without JS thankfully! :) Just start your webplayer up like this: unityObject.embedUnity("unityPlayer", "fit2cure.unity3d", "100%", "100%", params); Then carefully set up all of your...

View Article


Answer by Flynn

C# is a bit more strict with how you are supposed to do things than JS -- It wants your functions to be clearly defined as iterator blocks, and it wants you to strictly call them using StartCoroutine....

View Article

Answer by Flynn

Using AOV instead of FOV might help! public var minFOV : float = 1; public var baseFOV : float = 0; public var czoom : float = 0; function Start () { baseFOV = Camera.main.fieldOfView; } function...

View Article

Answer by Flynn

Unfortunately, the answer appears to be no. :( You can double check this yourself by going to [http://docs.unity3d.com/Documentation/ScriptReference/MonoCompatibility.html][1] I believe that "Micro"...

View Article


Answer by Flynn

If I understand your requirements, this should work: Vector3[] vertices = new Vector3[faces.Length*3]; int[] tris = new Vector3[faces.Length*3]; for (int i = 0; i < faces.Length;) { for (int j = 0;...

View Article


Answer by Flynn

Theoretically, setting timesScale to 0 right when you press the New Game button would work (unless you have some kind of crazy cool animation going on), however, if that is not an option, you can try...

View Article

Answer by Flynn

You will need to encapsulate your integers in a Vector3, like this: if(Input.GetMouseButtonDown(0) && collider.Raycast(Camera.main.ScreenPointToRay(new Vector3(Screen.width / 2, (Screen.height...

View Article

Answer by Flynn

Hello, there! First of all, I suggest that instead of using boolean signals to tell SpawnEnemy to spawn, that you instead go a little more directly: ###EnemySpawn.js: #pragma strict var prefab :...

View Article

Answer by Flynn

Honestly, there really aren't many ways to clean up your code's redundancy (without seriously overcomplicating your code and getting into sticky things like delegates...... blech). However, one last...

View Article


Answer by Flynn

That depends! Generally, if you are developing for web-player, do NOT exceed a 700 pixel height. Many users have smaller screens, and on top of that, the web browser will eat a good 100 pixels of that...

View Article

Answer by Flynn

GUI.Enabled is intended to be used in the OnGUI() function -- The idea is that you set GUI.Enabled to false right before the code that draws the button, then set GUI.Enabled back to true right after...

View Article


Answer by Flynn

That is a very broad question you asked there. It's more of a "How do I go about programming this" question than "What is the issue HERE" question. You'd have better luck with answers on the forum I...

View Article

Answer by Flynn

Mathematically calculate your rotation based on speed: float rotX = (verticalSpeed / maximumVerticalSpeed) * 45 IF the object is traveling downwards at maximum speed, this will return -45. It will...

View Article


Answer by Flynn

var testing : Test = new Test(); This goes into memory handling in code -- There are two types of variables, basic variables, and objects. Basic variables are ALL either a number type (float, integer,...

View Article

Answer by Flynn

There is a slight trick you could use: For simplicity, let's say we have a cube with a script with an int value. It is from a prefab. We have two prefabs in the scene which are exactly the same, wit...

View Article

Answer by Flynn

Physics.Raycast does not take a rotation, it takes a direction. (1, 0, 0) is a direction that points in the X axis direction, but is not rotated 1 degree on the x axis. (0.5, 0.5, 0) would be a...

View Article
Browsing all 59 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>