New answers tagged unity-game-engine
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'...
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 ...
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 ...
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 ...
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 ...
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 (...
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 ...
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 ...
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....
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
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 ...
Advice
0 votes
0 replies
0 views
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 ...
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 ...
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 { ...
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<...
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....
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 ...
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 ...
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 ...
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 ...
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;
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 ...
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
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
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.
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() => ...
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(), ...
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 ...
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!
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 ...
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.
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 ...
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 ...
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 ...
Top 50 recent answers are included
Related Tags
unity-game-engine × 76875c# × 43683
android × 6629
ios × 2485
game-development × 1535
visual-studio × 1533
unityscript × 1284
firebase × 1217
2d × 1183
shader × 1163
augmented-reality × 1105
animation × 1077
vuforia × 1070
user-interface × 1030
game-physics × 969
hololens × 966
virtual-reality × 917
xcode × 884
rotation × 818
json × 760
facebook × 726
3d × 696
gameobject × 694
camera × 678
game-engine × 635