Quantcast
Channel: Answers by "jaskij"
Browsing all 37 articles
Browse latest View live

Answer by jaskij

Depending on your code, you might want to put it as [System.Serializable] public class MainClass : MonoBehaviour { public class TestClass { public int y; } public TestClass test; } since it's a more...

View Article



Answer by jaskij

The point here, Time.deltaTime returns values smaller then 1, so rounding it before addition will give you tons of toubles. Best thing to do here would be to store the score as a float and only round...

View Article

Answer by jaskij

Arrows, control for moving by a word, shift for selecting, ctrl+home beginning of document, ctrl+end EOF.

View Article

Answer by jaskij

Definitely looks like a bug. [IEEE-754][1] states that even a float should be able to hold 5e18. [1]: http://en.wikipedia.org/wiki/IEEE_754

View Article

Answer by jaskij

IMO when it comes to coding, Euler angles are more complicated than quaternions, since there are so many friggin' exceptions you need to consider to avoid a [gimbal lock][1]. Although I cannot give you...

View Article


Answer by jaskij

Do not move the object by means of moving the transform. Instead, modify the speed of the rigidbody (that should be done in the FixedUpdate() method inherited from MonoBehaviour). Preferably by using...

View Article

Answer by jaskij

Make a gameobject for the craft with only the rigidbody, and move the rendering components to the child object, then make a public Transform variable to which you assign the rendering childs transform....

View Article

Answer by jaskij

Try putting a script on the camera (if the SkyBox is camera specific) and changing it's gameObject.active. If that doesn't work, make two cameras, of which only one has a skybox and switch between them...

View Article


Answer by jaskij

Ok, looking at those things, and doing some research of my own, I dare say that iris folding would be the fastest, then Verlet (if you know derivateves and such, look at [en.Wiki][1], it becomes quite...

View Article


Answer by jaskij

I'd say: make the render a child GameObject (so that it's rotation doesn't affect rigidbody's rotation) then keep that rotation in a separate variable, then when the player presses forward apply a...

View Article

Answer by jaskij

According to [this][1] you have to use the virtual keyword, like class Animal { virtual static var desc : String = "I'm an animal"; } class Bird extends Animal { static var desc : String = "I'm a...

View Article

Answer by jaskij

What Zergling103 wrote seems legit, but IMO it's better to have a centralized event manager system, like the one described in the runner tuto @ [catlikecoding.com][1] Although that tuto is good, since...

View Article

Answer by jaskij

1. DON'T USE ALL CAPS, no one likes to be shouted at 2. AFAIK you can't change a color of part of the text with standard Unity GUI text elements, you need a 3rd party resource for that. 3. Why would...

View Article


Answer by jaskij

http://social.msdn.microsoft.com/forums/en-US/csharpgeneral/thread/a7ddde89-35cc-4a29-9aab-ac42b8fd75fe

View Article

Answer by jaskij

If they're indeed shooting at each other, changing the scene for that seems kinda strange... Shouldn't you rather just switch the camera? And you have to set up the levels in the build options for them...

View Article


Answer by jaskij

Ok, either I'm stupidly misreading something, or you just need something like if(FlashLightOn){ light.intensity = lightIntensity; } near the end of your Update()

View Article

Answer by jaskij

If that script is on the object itself, then it won't work. The thing is, Update() is **NOT** called on inactive objects.

View Article


Answer by jaskij

IMO, the point here is that currenCommand is a reference too. So you only enqueue reference to the array which you change. I'm new to C# as well (similar circumstances to You), but if C# supports copy...

View Article

Answer by jaskij

1. Format your code (the button with ones and zeroes). 2. Transform is a class name, not an object of that class - and that is what you need. Consider code below. var speed = 3.0; var...

View Article

Answer by jaskij

Depending on your code, you might want to put it as [System.Serializable] public class MainClass : MonoBehaviour { public class TestClass { public int y; } public TestClass test; } since it's a more...

View Article
Browsing all 37 articles
Browse latest View live




Latest Images