Quantcast
Channel: Answers by "idbrii"
Browsing latest articles
Browse All 87 View Live

Answer by idbrii

Turns out that even [back on 5.6, the documentation says:](https://docs.unity3d.com/560/Documentation/ScriptReference/PropertyDrawer.html)> Note that for performance reasons, EditorGUILayout...

View Article



Answer by idbrii

> I want to use the auto layout system> to make things easier on myself> (basically using static methods from> "EditorGUILayout" instead of> "EditorGUI") but this results in the>...

View Article

Answer by idbrii

I had the same ArgumentException problem and it turns out the [documentation for PropertyDrawer](https://docs.unity3d.com/ScriptReference/PropertyDrawer.html) says:> Note that for performance...

View Article

Answer by idbrii

Another reason ArgumentException can be happening is from trying to use EditorGUILayout functions in PropertyDrawers. It turns out the [documentation for...

View Article

Answer by idbrii

Here's my attempt at making functions to apply stretch anchors: public static void SetStretchAnchorAll(RectTransform t) { t.pivot = Vector2.one * 0.5f; t.anchorMin = Vector2.zero; t.anchorMax =...

View Article


Answer by idbrii

Similar answer but instead of Object.FindObjectsOfType(typeof(GameObject)), use SceneManager.GetActiveScene().GetRootGameObjects() so you only look at each object once. (FindObjectsOfType should find...

View Article

Answer by idbrii

In more recent versions of Unity (2019) and UI.Text, it looks like the new solution is [TextGenerator][1]. [1]: https://docs.unity3d.com/ScriptReference/TextGenerator.html

View Article

Answer by idbrii

To add to VesuvianPrime's great answer, since you have a Transform, you can use **localToWorldMatrix** to create your matrix. I think it's the same as `Matrix4x4.TRS(transform.position,...

View Article


Answer by idbrii

Try using the free [Navmesh Cleaner](https://assetstore.unity.com/packages/tools/ai/navmesh-cleaner-151501) asset. It automatically creates NonWalkable volumes around areas that don't seem reachable....

View Article


Answer by idbrii

> i want to create a copy of the drawn linerenderer of every frame or second Where you do this: lRenderer.SetPosition(i, cubePos - goTransform.position); Save the position in a Vector3[]:...

View Article

Answer by idbrii

Probably the best you can do is copy how [NavMeshSurface.BuildNavMesh](https://github.com/Unity-Technologies/NavMeshComponents/blob/master/Assets/NavMeshComponents/Scripts/NavMeshSurface.cs#L159-L182)...

View Article

Answer by idbrii

> There is no way to do an automatic connection between two navmesh surface component Try [unity-navgen][1] or one of the linked alternatives. >> if it's possible to fall from a surface...

View Article

Answer by idbrii

Duplicating my platform and moving it away from a wall got navmesh to generate on top of it. I think the reason is hinted by the [Tile Size documentation][1]: > The NavMesh is built in square tiles...

View Article


Answer by idbrii

An expansion on @bjennings76 's answer that uses the fill anchor for RectTransforms: public static class Shortcuts { [MenuItem("GameObject/Group Selected %g")] private static void GroupSelected() { if...

View Article

Answer by idbrii

You should be able to make it readable by enabling "Read/Write Enabled" in the atlas's Import Settings inspector.

View Article


Answer by idbrii

You need to assign scrollPosition to your Vector2 for the scrollview's scrolling to be stored between frames. For some reason, ScrollViewScope doesn't do this automatically. See below for a subclass of...

View Article

Answer by idbrii

SpriteRenderer has a flip checkbox to mirror it. ![](https://forum.unity.com/attachments/upload_2015-12-24_15-27-27-png.167111/) Answer from...

View Article


Answer by idbrii

Honestly, one of the easiest/most foolproof ways is to add a TMPro.TextMeshPro to your prefab. You can position it relative to the object, it generates easy to read text, and it's easy to change the...

View Article

Answer by idbrii

From [the forum post "returning a byte array to c# from objc"](https://forum.unity.com/threads/returning-a-byte-array-to-c-from-objc.93503/#post-6833597): # Obj-C Bundle is called PluginName.bundle //...

View Article

Answer by idbrii

You can get an array of bytes from an NSBitmapImageRep. However, there's some hoops to jump through to get one of those from an NSImage. You'll also want to resize the image to avoid getting back a...

View Article

Answer by idbrii

[HingeJoint2D has angle limits][1]. You can use those to prevent 360 rotation. You could check [jointAngle](https://docs.unity3d.com/ScriptReference/HingeJoint2D-jointAngle.html) in Update() for when...

View Article


Answer by idbrii

If you put your object under a parent that sets the world position, you can offset the localPosition to give it shake and when your offset goes to zero your object will return to the neutral position....

View Article


Answer by idbrii

In your code, you could add `myCamera.localPosition = originalCamPos` before yield break. If you put your object under a parent that sets the world position, you can offset the localPosition to give it...

View Article

Answer by idbrii

If you put your object under a parent that sets the world position, you can offset the localPosition to give it shake and when your offset goes to zero your object will return to the neutral position....

View Article

Answer by idbrii

If you put your object under a parent that sets the world position, you can offset the localPosition to give it shake and when your offset goes to zero your object will return to the neutral position....

View Article


Answer by idbrii

If you put your object under a parent that sets the world position, you can offset the localPosition to give it shake and when your offset goes to zero your object will return to the neutral position....

View Article

Answer by idbrii

If you don't want to write your own PropertyDrawer, you can use [NaughtyAttributes.Label][1]: public class Luces : MonoBehaviour { [Header("Luces")] [Label("Roja")] public Light luzRoja; // ......

View Article

Answer by idbrii

You're missing a call to [Camera.Render][1] and [Texture2D.Apply][2]. Something like this should work: public Texture2D ToTexture2D(RenderTexture rTex) { RenderTexture currentActiveRT =...

View Article

Answer by idbrii

Setup an orthographic camera where the size is set to the z of the bounds and render to a render texture with the same aspect ratio as the bounds. Here's my solution: public RawImage _MapImage; //...

View Article



Answer by idbrii

InverseLerp finds the **progress** between two values. For `InverseLerp(float a, float b, float value)`, *a* is the start, *b* is the end, *value* is the current position. It returns how far along the...

View Article
Browsing latest articles
Browse All 87 View Live




Latest Images