Quantcast
Channel: Answers by "Loius"
Browsing latest articles
Browse All 190 View Live

Answer by Loius

I have no experience myself, but this is a promising link - http://stackoverflow.com/questions/734618/disabling-accessibility-shortcuts-in-net-application

View Article



Answer by Loius

You need to transform your input vector from world space into camera space. The function for this is either Transform.TransformDirection or Transform.InverseTransformDirection (I always forget)....

View Article

Answer by Loius

When you add a collider to an object, Unity tries to fit the collider to the object's renderer (works with Box, Mesh, and Sphere at least). So you could just have an editor script that's something like...

View Article

Answer by Loius

I have no idea what XCode is, but there's this, and it doesn't require you trying to get two things to work together so it's instant win in my book....

View Article

Answer by Loius

One meter is one unit (by default). So however many pixels per meter your images are is what determines your pixel-to-unit ratio. If you have 100 pixels per meter then you should use 100 pixels per...

View Article


Answer by Loius

Raycast isn't an event-driven action, so there's no way to listen for "not being hit by raycast". Whoever is casting the ray is responsible for notifying everyone of the ray's actions. You'd just need...

View Article

Answer by Loius

public float variable = 10f; If you change that value from 10 to something else, then go back to Unity, it will not change the value in the inspector, because that is how it works. The inspector value...

View Article

Answer by Loius

Unity runs in a single thread - Updates and other Unity special functions are called sequentially and they can block. Normal functions are not threaded and cause blocking behaviour (your code blocks...

View Article


Answer by Loius

Just use a plane. You can only collide with a plane if you're moving towards its surface normal. _____^_____ Lay the plane flat (on X/Z) and point it up (visible side pointing along +Y) and it should...

View Article


Answer by Loius

use static variables (static values persist between scenes) or save to PlayerPrefs and reload in the score display scene http://docs.unity3d.com/ScriptReference/PlayerPrefs.html

View Article

Answer by Loius

You most likely need to change the filtering from Bilinear to Point, and you may need to change the texture format from Compressed to 16bit or even Truecolor (although that will raise the disc-space...

View Article

Answer by Loius

But nothing's wrong, that's how everything works. If you're not touching your screen, then it's not a touch, and if there's not enough room for your full resolution, then it uses something of the same...

View Article

Answer by Loius

Right-click key, Both Tangents -> Constant Constant means that the key's value will be constant from this key to the next. You can also keep a key constant on just one tangent (one side) so it will...

View Article


Answer by Loius

Well a vector2 has x and y properties... And if you want it to stay square you can just use rotationSpeed = Vector2.one * sliderValue.

View Article

Answer by Loius

http://docs.unity3d.com/ScriptReference/GUI.Label.html http://docs.unity3d.com/ScriptReference/GUILayout.Label.html There is a parameter for choosing what style to use. GUILayout.Label("I am...

View Article


Answer by Loius

http://forum.unity3d.com/threads/free-admob-plugin-simple-prefab.167731/

View Article

Answer by Loius

you should avoid relying on object names wherever possible. you never NEED an object's name; it's similar to lazy-typing in Unityscript in that it can make it easier to code but you introduce headaches...

View Article


Answer by Loius

Structs with System.Serializable attribute can now be serialized. Type UnityEngine.Vector3 is not marked as Serializable. Therefore Vector3 is not in the category of things that can now be serialized....

View Article

Answer by Loius

http://unity3d.com/search?refinement=answers&gq=bce0005

View Article

Answer by Loius

public class Clickable : MonoBehaviour { public virtual string[] Options { get { return new string[0]; } } public virtual void HandleClick() { } } public class Shopkeeper : Clickable { public override...

View Article

Answer by Loius

Try this out for brute-forcing a 360* cast: void Update () { Ray ray = new Ray(); ray.origin = Vector3.zero; float inverseResolution = 10f; Vector3 direction = Vector3.right; int steps =...

View Article


Answer by Loius

http://docs.unity3d.com/ScriptReference/MeshCollider.html http://docs.unity3d.com/ScriptReference/Mesh.html http://docs.unity3d.com/ScriptReference/PolygonCollider2D.html

View Article


Answer by Loius

this is a duplicate question. did you search for your error message? i've answered this the same way several times now, and that's just me. null reference exception: "something before a . is null"....

View Article

Answer by Loius

if ( name == spawnedObstacleName ) { // stuff } That said, don't use object names. It's extremely unreliable because someone will make a typo at some point and it will be extremely hard to track down...

View Article

Answer by Loius

Deleted my old answer due to me typing it hastily and it sucking in general. This should be more correct: private var collisions : int = 0; function OnTriggerEnter(c : Collider) { collisions++;...

View Article


Answer by Loius

This creates {gos.length} null references to treeprototypes: TreePrototype[] trees = new TreePrototype[gos.Length]; You have to initialize them: for(int i=0; i

View Article

Answer by Loius

Just keep track of when they enter the collider, and once they've not exited it for long enough, success: public class LocationMonitor : MonoBehaviour { public float requiredTime = 5f; float enteredAt...

View Article

Answer by Loius

What's preventing you from updating the image? Don't delete the image, just overwrite it.

View Article

Answer by Loius

Slerp (Lerp) from a rotation to a target rotation. What you're doing is rotating from the current rotation to the target rotation, which is constantly getting smaller as you get closer. You need to...

View Article



Answer by Loius

Your Edit > Project Settings > Input Settings should be adjusted to taste. Specifically the Gravity (how quickly the input returns to zero after the player releases it) and Acceleration (how...

View Article
Browsing latest articles
Browse All 190 View Live




Latest Images