Skip to main content

New answers tagged

Best practices
0 votes
0 replies
0 views

Naming Conventions: Manager, System. Handler or Service?

I'd say something that runs in the background is a service, but reallly it's up to you. A system would be the whole thing, all the components, not just the front-end that the user sees. But really it'...
ADyson's user avatar
  • 63.1k
Best practices
1 vote
0 replies
0 views

Naming Conventions: Manager, System. Handler or Service?

There is no standard here. I think it's more important to be internally consistent with your naming conventions, such that when people encounter FooSystem, they understand generally where within the ...
Greg Burghardt's user avatar
Advice
0 votes
0 replies
0 views

How to shift two intersecting polygons

Thansk! I'll definitely keep this in mind. I actually got it working (ish) a bit differently and then realized it looked really ugly so I decided to actually force intersections so that it looks more ...
Nameugone's user avatar
2 votes
Accepted

Unity crashes after I run my save file script

As far as I can tell there are various issues here: First of all it makes no sense to try and plain out serialize a GameObject to JSON. What exactly is a GameObject supposed to look like in JSON? It ...
derHugo's user avatar
  • 93.2k
0 votes

Instantiate objects at spawn points

I'm guessing that in more than one of the Update() calls that QuestManager.questManager.RequestAcceptedQuest(1) is returning true, causing SpawnFlowers() to run each time. To fix that, you could fix ...
John B's user avatar
  • 20.5k
2 votes

Unity NGO NetworkList of struct that contains an array of struct

While not directly answering the original question, I ended up finding a workaround that actually works great and is way simpler than my initial attempt. Instead of having a 3-step hierarchy (...
Jibs's user avatar
  • 91
2 votes
Accepted

Unity NGO NetworkList of struct that contains an array of struct

See Arrays and native containers You can basically go similar to the Job System and make use of Unity's struct based NativeArray for this. Alternatively as mentioned on the page above as well you can ...
derHugo's user avatar
  • 93.2k
1 vote

Why is my Object not updating its relevant position to myHands?

Having a scan through, I see that on every call to Update, if nothing else happens, you call TryPickupRaycast. Also, when throwing, there's nothing to indicate that you stop holding the object (even ...
Jonathan Johansen's user avatar
0 votes

Unity trail renderer is shrinking at the end

I know it's been 5 years, but I've found a very simple solution: Each time you set "Emitting" to true or false, add this line after it: trailRenderer.AddPosition(trailRenderer.transform....
HemoSul's user avatar
Advice
0 votes
0 replies
0 views

How can i rotate my player according to mouse position?

go watch codemonkey tutorial on youtube, he has this exact thing
BugFinder's user avatar
  • 18k
0 votes

Is there an equivalent to async.then (like in JS) for coroutines in unity?

In Swoole (for PHP) which is inspired by Golang (Goroutines) and Vert.x / Netty (Java coroutines) : You can do one of below: 1. For mutually sequential (but over-all asynchronous) operations between ...
Fakhar Anwar's user avatar
Advice
0 votes
0 replies
0 views

How can i rotate my player according to mouse position?

Game Development might be a better fit.
Velvet's user avatar
  • 220
Advice
0 votes
0 replies
0 views

How to compare 3d directions as equidistant on both diagonal and horizontal/vertical

Edit: Ok, now I get it. Vector(x, y, z) where x, y, z ∈ {-1, 0, 1} gives you 3^3 - 1 graph nodes (excluding Vector(0, 0, 0)) and you want them all to have edges to their neighbors. What a neighbor ...
Stef's user avatar
  • 15.7k
Advice
0 votes
0 replies
0 views

How to compare 3d directions as equidistant on both diagonal and horizontal/vertical

"Up-UpRIght is 45 degrees, but Up-UpRightForward is ~54.7 degrees. Likewise going from UpRight-UpRightForward is ~35.3 degrees. I understand that this is normal maths but, for the purposes of ...
Stef's user avatar
  • 15.7k
5 votes

How to make a list of objects visible in Unity Inspector?

First of all I would recommend a ScriptableObject for this kind of profile things [CreateAssetMenu] // <- can be further customized via parameters public class WeaponProperties : ScriptableObject { ...
derHugo's user avatar
  • 93.2k
1 vote

How to make a list of objects visible in Unity Inspector?

I ended up doing an overly complicated code IMO, but it does what I wanted to do In unity inspecctor I can select selectedWeapon and other scripts can read from CurrentWeapon static public List<...
user32461849's user avatar
0 votes

Unity3D New Input System: Is it really so hard to stop UI clickthroughs (or figure out if cursor is over a UI object)?

Here’s the simple approach I came up with: private void OnAttack(InputAction.CallbackContext context) { var screenPos = Mouse.current.position.value; var panel = uIDocument....
jhocking's user avatar
  • 5,587
Advice
0 votes
0 replies
0 views

How to shift two intersecting polygons

Essentially, what you'd need to do here is find the Minkowski difference of the two polygons, and then determine the closest point on the result to the origin. Unfortunately, generating the Minkowski ...
Sneftel's user avatar
  • 41k
Advice
1 vote
0 replies
0 views

How to compare 3d directions as equidistant on both diagonal and horizontal/vertical

I think you cut down your example too much. I at least have no clue what you are actually trying to achieve and what your current solution does. It sounds like you want the diagonal of a unit square ...
Good Night Nerd Pride's user avatar
Advice
0 votes
0 replies
0 views

How to compare 3d directions as equidistant on both diagonal and horizontal/vertical

I'm not sure I understand what you are actually trying to do here. Is the end goal to include directions while doing pathfinding? i.e. make turning more expensive than going straight ahead in an ...
JonasH's user avatar
  • 39.3k
Advice
2 votes
0 replies
0 views

How to compare 3d directions as equidistant on both diagonal and horizontal/vertical

It sounds like it would be easier to work with polar coordinates, or more specifically, spherical coordinates. r: The length of the vector, presumably 1 in your example. theta: The horizontal ...
Dean's user avatar
  • 1
0 votes

Unity : How to make physics 2d raycaster go through UI elements?

For those using UI Toolkit now the solution is: root.pickingMode = PickingMode.Ignore;
Romain Bitard's user avatar
0 votes

Unity Material coming up as null from UIToolkit, and it won't set custom attributes

Material properties in UIToolkit need to be set through the "ResolvedStyle" rather than "Style". Logging most properties involved with "Style" will likely return a null ...
Vaughan Schmidt Vowgan's user avatar
Best practices
0 votes
0 replies
0 views

Best practice for separating level meshes in Unity/Blender (ceiling and main map)?

delete the answer and i will delete the post, thx. swithcing to another forum
Atto's user avatar
  • 109
Best practices
0 votes
0 replies
0 views

Best practice for separating level meshes in Unity/Blender (ceiling and main map)?

"how you split them but ended with 2 parts that dont join" You can split 2 meshes, by selecting the edges and cut it in 2 objects. Can't delete the questions since there is answers now xd
Atto's user avatar
  • 109
Best practices
0 votes
0 replies
0 views

Best practice for separating level meshes in Unity/Blender (ceiling and main map)?

While I agree id be interested in this, and I am curious how you split them but ended with 2 parts that dont join, however, this is not a SO question. sorry.
BugFinder's user avatar
  • 18k
0 votes

Run code in a MonoBehaviour whenever another component is added

Editor Make OnComponentAdded public. Create the ComponentService script in the Editor folder: using UnityEngine; [InitializeOnLoad] public class ComponentService{ static ComponentService() => ...
Vladimir's user avatar
  • 699
2 votes

How to spawn object around a specific point with specific radius in Unity2D using C#

I know this was answered a long time ago, but I was shocked to see the unnecessarily high complexity of the top answer. A much simpler solution is this: Instantiate(enemyPrefab, SetSpawnPos(), ...
M S's user avatar
  • 111
0 votes

Is there a way to take a screen shot in macOS programmatically?

I was also stuck with a similar issue and tried implementing mss like screen grab using the macOS screencapturekit (Mostly Vibe Coded but it works). Went from 15 fps to 55 fps on full screen ...
Harshit Ahlawat's user avatar
Advice
1 vote
0 replies
0 views

Confusion on TextureHandle disposal in URP Render Graph

Hummm... I'm unable to do that either, it seems like I need a minimum reputation of 15 to unlock upvoting, I'm sorry for that, and thanks again for your help!
Jesse's user avatar
  • 1
Advice
0 votes
0 replies
0 views

Confusion on TextureHandle disposal in URP Render Graph

I have no clue. This looks like a Discussion type thread, not a Question, so it might not have "an answer". Normal questions have the tick next to the answer. I guess you can just upvote the ...
NPatch's user avatar
  • 475
Advice
0 votes
0 replies
0 views

Confusion on TextureHandle disposal in URP Render Graph

I know this is off-topic, but how can I mark your reply as the solution? I’m new to Stack Overflow and can’t find any button to do that.
Jesse's user avatar
  • 1
Advice
0 votes
0 replies
0 views

Confusion on TextureHandle disposal in URP Render Graph

From what I understand, TextureHandle is what RenderGraph uses internally to track textures (temporary or otherwise) and it mostly automatically releases them by the end of the frame (or Graph for ...
NPatch's user avatar
  • 475
0 votes

Unity Addressables for Android: Missing Textures with scene

Beforehand this was happening in both the editor and when I built it to an android phone. But now I'm testing with an android phone and it's fine. Maybe I forgot to test it before or I fixed it ...
MinerSheep's user avatar
0 votes

Getting this error while making build in UNity

Fixed mine just by shortening my project folder's name, so that I achieve shorter absolute file path. I followed this post. "C/C++: ninja: error: manifest 'build.ninja' still dirty after ...
LTYGUYDev's user avatar

Top 50 recent answers are included