I found it helpful. I can relate to problem the OP was having. I would like to share a meaningful update to the thread with a nice diagram and some code, eg:
bool IsPointOnBoxEdgeOrCorner(BoxCollider box, Vector3 worldPoint, out Vector3 bestNormal) {
bestNormal = Vector3.zero;
// Convert world hit point to local space of the box
Transform boxTransform = box.transform;
Vector3 localPoint = boxTransform.InverseTransformPoint(worldPoint);
Vector3 halfSize = box.size * 0.5f; // Box extents in local space
// Tolerance for detecting edges/corners (adjust if needed)
float threshold = 0.05f;
// Determine proximity to each face
bool nearX = Mathf.Abs(Mathf.Abs(localPoint.x) - halfSize.x) < threshold;
bool nearY = Mathf.Abs(Mathf.Abs(localPoint.y) - halfSize.y) < threshold;
bool nearZ = Mathf.Abs(Mathf.Abs(localPoint.z) - halfSize.z) < threshold;
// Count how many faces the point is near
int nearCount = (nearX ? 1 : 0) + (nearY ? 1 : 0) + (nearZ ? 1 : 0);
if (nearCount >= 2) // Edge (2 faces) or Corner (3 faces)
{
List<Vector3> candidateNormals = new List<Vector3>();
if (nearX) candidateNormals.Add(boxTransform.right * Mathf.Sign(localPoint.x));
if (nearY) candidateNormals.Add(boxTransform.up * Mathf.Sign(localPoint.y));
if (nearZ) candidateNormals.Add(boxTransform.forward * Mathf.Sign(localPoint.z));
// Pick the normal that is closest to world up
bestNormal = candidateNormals.OrderByDescending(n => Vector3.Dot(n, Vector3.up)).First();
return true;
}
return false; // Not an edge or corner
}
But it is locked. I would like to understand why I can’t give back to the community.
I hope I’m asking this question in the right place, eg the Unity Discussions Feedback area.
I’m happy you found it helpful, including the follow up suggestions from others.
As for why are threads locked after 2 years? I think Antypodish outlined that pretty spot on. Before implementing it threads got necroed all the time. Just myself personally I’d get alerts multiple times a day of my own threads being necroed. It didn’t necessarily bother me personally, but if it was happening to me, it had to be happening to others. And that likely led to the discussion about implementing the policy.
Locking them after two years, which is plenty of time, is a good thing. A not insignificant amount of threads in general on the old forums were pointless necros that were either from spambots, people starting fights with posts from users not even on the forums anymore, or people going “thanks!” on posts from 2012. It lead to meaningless clutter and boosted often irrelevant posts that referenced APIs long changed
Plenty of time have I googled something, where the first results that show up is out of date, where the API has changed, where the chosen answer was wrong or had some kind of issue.
I understand that people don’t want to get spammed by old thread they happen to have replied to, but I wish there was some kind of in-between solution.
Maybe some way to allow people to create “follow ups” to any posts that would not notify any of the people who replied to the original. These follows ups could show up at the top of the thread, and should only be created if the thread is closed.
What @Antypodish said is spot on. One important nuance is that it’s 2 years after the last reply, not after the topic was created.
Good news, that’s pretty much how it works, minus the only happening when closed. Including the URL of topic A in your post within topic B will create a reference of topic B in topic A, right under the original post. This is arguably not the most impactful location for these references to be helpful in the context of encountering a closed topic but this is not the only mechanism to help here.
I appreciate that there’s already some kind of mechanism for I have some comment;
It would be very nice if the “links” were shown in a more impactful way/place, especially if the thread is locked. I am certain that a lot of people are just going to click out of the page and leave after seeing that the thread is locked and that their question remained unanswered.
A lot of people might forget to link the old post. It would be neat if moderators or people above a certain trust level were able to attach a link to another post like stackoverflow seems to be doing. (SO also makes the related post/duplicate questions very obvious, at the top of the page).
I don’t like what shows up in “related topics”, it seems to be algorithm driven and often picks barely related topic. Often just picking a post with mentioning similar terms like “DOTS” or “Physics Raycast” without really having any meaningful connection. I wish I could see how often related topics are actually used. Maybe that list could be tweaked to show up posts that link it at the top (if it doesn’t already?)
Either way, I miss the old forum, but I’m also growing for of this new Discussions thing, it’s not a bad replacement IMO, as long as you guys keep improving it : )
Alright, well thanks for the sincere replies all. I guess I can see both sides of the argument.
On an unrelated note, is it just me or do the forums/Unity community in general seem a bit less active than years ago? I feel like whenever I Google my questions now, most of the threads/topics I find are a few years old anyway, or nothing really relevant comes up at all.
Perhaps due to all the fragmentation of Unity (eg render pipelines) and abandoned frameworks over the years? Combined with Unity leadership/company pivots? Anyway I digress, keep on keeping on my fellow game devs.