Modifying Wireframe Vertex Shader to Include Lighting & Shadows
**Hello fellow developers!** **I humbly seek the community’s assistance in combining two seemingly simple shaders into a single perfect shader.** Until a week ago, I was completely ignorant of the...
View ArticleExtents of a Compound GameObject (C#)
My third-person character picks up objects of various sizes. These objects are composed of a GameObject with an attached Rigidbody, and a number of child objects with attached Colliders. My goal is to...
View ArticlePer-Axis (Euler) Rotation Control While Avoiding Gimbal Lock
I am writing a target-following script with numerous per-axis settings. Below is the most distilled example I can provide of the rotation portion: private void Rotate() { var _target =...
View ArticleRetrieve Variable's [Tooltip()] Property From a Custom Inspector (C#)
Hello, I have been searching for a solution to this question for quite a while, unfortunately, to no avail: How does one retrieve a script's [[Tooltip()] property from within a Custom Inspector? I wish...
View ArticlePrevent Rigidbody from Climbing Steep Slopes using Forces (C#)
Hello all! I have been wracking my brain for weeks trying to solve this issue. Any assistance is greatly appreciated! I’ve created a custom Rigidbody FPS controller. I need to prevent it from climbing...
View ArticlePercentage of Collider within a Trigger Area (C#)
**Hello fellow Unity Developers,** I am attempting to create a C# function that linearly interpolates a Rigidbody’s drag based upon the *percentage of the Rigidbody’s collider that is within a trigger...
View ArticleRe-Creating Unity's Friction and Bounce
Hello Unity friends! **I am in the process of emulating Unity's physics via script.** Thus far, I've successfully emulated gravity and drag as such: using UnityEngine; public class RePhysics :...
View ArticleHow to record hideFlags for Undo/Redo
**Greetings!** Thank you in advance for your help. How do you record a GameObject's hideFlag state change in the Undo/Redo system? I have tried both Undo.RecordObject and...
View ArticleInsert new custom class element with _default_ values to a SerializedProperty...
In a custom inspector, I am adding a new custom class "DSReaction" element to a native array named "reactions" obtained via a SerializedProperty. To add the new element to the "reactions" array, I'm...
View ArticleEndChangeCheck() not called by all [CanEditMultipleObjects] custom Inspector...
**Hello,** The purpose of the code below may seem a bit obtuse, so I'll describe it briefly, as I've omitted the portions not relevant to the issue. I've created a custom inspector with a "dummy"...
View ArticleRadius of a Non-Uniform Sphereoid/Ellipsoid at a Given Surface Point?
Hello! I have spent a few days mulling over this problem, but have made little progress. Unfortunately, spherical trigonometry is not my strong point. I hope you can help! What I require is a function...
View ArticleRetrieve Array of Texture2Ds dropped in EditorWindow ObjectField
**Hello!** How would I retrieve an array of Texture2Ds that are dropped onto an ObjectField in an EditorWindow with a typeof Sprite? I'm quite familiar with editor/inspector scripting, but this one has...
View ArticleC#: Include Custom Editor features for a custom Classes while avoiding...
**Hello,** First, apologies if this has already been answered, but my searches have failed me. **My question:** *How would one approach creating a custom Editor tool with support for custom classes,...
View ArticleDetect Unity Editor Step Button Click Without Using of Unity's Time Class
Hello! How would I detect use of the Unity editor's "Step" button/menu item/keyboard shortcut without use of Unity's Time class? I have created a custom PlayerLoop to allow for the manual triggering of...
View Article