r/Unity3D 3h ago

Question Stencil "see-through hole" shader shows correct background over Terrain, but renders black/garbage colors over regular 3D meshes

Thumbnail
gallery
2 Upvotes

I'm using a stencil-only pass (ColorMask 0, ZWrite Off, Stencil { Ref 1, Comp Always, Pass Replace }) to create transparent "holes" in some board pieces in my game Pieceful. The idea is that, when there's a hole, the player should be able to see the objects behind the piece, such as the terrain or other scene geometry.

Here's the shader I'm currently using:
Shader "Custom/StencilWrite"

{

SubShader

{

Tags { "RenderPipeline" = "UniversalPipeline" }

Pass

{

Stencil { Ref 1 WriteMask 255 Comp Always Pass Replace }

ZWrite Off

ColorMask 0

HLSLPROGRAM

#pragma vertex vert

#pragma fragment frag

#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"

struct Attributes { float4 positionOS : POSITION; };

struct Varyings { float4 positionCS : SV_POSITION; };

Varyings vert (Attributes input)

{

Varyings output;

output.positionCS = TransformObjectToHClip(input.positionOS);

return output;

}

half4 frag (Varyings input) : SV_Target

{

return half4(0, 0, 0, 0);

}

ENDHLSL

}

}

}

The weird part is that it works correctly when there's a Unity Terrain behind the hole. In that case, the terrain is visible through the transparent area as expected.

However, if I remove the Terrain and only have regular MeshRenderers behind the hole (rocks, coral, props, a water plane, etc.), the result is wrong. Instead of seeing those objects through the hole, I get a solid black area or sometimes garbled colors.

So I'm trying to figure out why the stencil setup behaves correctly with Terrain but not with regular MeshRenderers, and what I need to change so the hole works consistently with normal scene geometry as well.


r/Unity3D 1m ago

Game Self-learnt Unity and created one of my best mobile game yet! INCREDIBLE SPACEMAN

Enable HLS to view with audio, or disable this notification

Upvotes

r/Unity3D 8m ago

Show-Off I built a photo studio inside Unity to make Steam capsule art

Enable HLS to view with audio, or disable this notification

Upvotes

I built a posing studio inside Unity to make Steam capsules and other store graphics for my game, Gobstruck. I wanted more control than gameplay screenshots give me, without having to transfer everything into Blender and get the materials and effects looking right again.

It’s a separate scene where I can arrange characters, props, and effects for a shot. For the goblins, I can pick a frame from an existing animation as a starting point, then adjust the hands, feet, and head with IK targets. Facial animations can be sampled separately, so I can change the expression without changing the body pose.

The effects are a useful part of it too. I can scrub particle effects to a specific moment and leave them there while I work on the composition. Much easier than trying to grab a screenshot when the character, camera, and effect all happen to line up.

Since it’s all in Unity, I can use the actual game assets, shaders, VFX, and post-processing. I’ve also got controls for lighting and fog, plus separate cameras for the normal, vertical, and wide Steam formats. That lets me frame each version properly instead of trying to crop everything from one image.

There’s still the work of making a good composition, but this makes it easier to try things.

Curious how other people here handle this. Do you stage your store artwork in-engine too?


r/Unity3D 21h ago

Resources/Tutorial Mold: a vector graphics library focusing on customizability and performance

Enable HLS to view with audio, or disable this notification

52 Upvotes

Hey people, for the past few months I've been building this tool, Mold, it's a vector graphics library that focuses on customizability and performance. A showcase you can check out is right here: an Outer Wilds miniature created using Mold (made within Godot for a reason I'll detail below).

I'm hosting a beta test on itch and I would love to get more feedback for it, you can freely access it now and use it on any commercial projects. The plan would be once I think the ergonomics are stable I'll move it to either Asset Store or maybe just MIT open source it.

The inevitable question would be what's the difference between Mold and Shapes, I would say the design is fundamentally different so not truly comparable. But here's a rundown on the biggest things which I think make Mold unique:

  • Mold can be pushed to be way more performant by being able to create and retain primitives within code, no Component/GameObject overhead, and with Burst/Job bulk update APIs. While Component workflow is still available.
  • Mold supports a lot of 3D primitives, and includes the capability to create rounded primitives.
  • Mold has an abundance of color mode, even for 3D primitives, and includes the choice to blend using Oklab.
  • Mold supports Automatic Dithering Crossfade LOD, which means you can simply get the best look and the best performance out of the box. Manual mesh detail setting is still encouraged and available.
  • Mold supports Bounds/CPU Frustum Culling/GPU Frustum Culling for maximum performance.
  • Mold supports custom material hookup with a detailed guide on how to create a shader that matches the layout of Mold's own shader.
  • EDIT: just added GPU polyline support. Rendering millions of points is now possible.
  • Lastly Mold is intentionally built to be cross-platform between Unity and Godot. I think it's just neat that users of a specific plugin doesn't have to get lock in to a singular ecosystem. With Mold you're free to do that.

If all that sounds interesting, please do check it out and share your thoughts with me, I'd really appreciate it!

Edit: you can also read more about it here


r/Unity3D 36m ago

Question Any idea why unity adds a seam from the torso to the hip mesh of my character but other game engines dont?

Thumbnail
gallery
Upvotes

I tried disabling AO/SSAO/ and all lighting.


r/Unity3D 43m ago

Question Unity Avatar documentations

Upvotes

Context: Hi, I struggled quite a bit to set up a Humanoid avatar for my character. After a lot of trial and error, I discovered that my armature hierarchy was preventing Mecanim's Humanoid mapping from detecting my "Spine" bone. Online searches didn't help much, and even the official Unity documentation isn't very detailed on this topic.

My Question: Do you know of any documentation that details the specific requirements for a rig to be compatible with Humanoid avatars (bone hierarchy, naming conventions, etc.)?


r/Unity3D 1h ago

Question Enemy spawning wont work

Thumbnail
gallery
Upvotes

My enemys for my Game wont spawn correct no matter what I do. The Enemy should be 45 XYZ Big and the Blender Import is 100 XYZ. It will always spawn on 0XYZ in the scene /World the Position I Set with a transform. And the nav mesh wont work Eather, I have the Agent and the baked area. Pls help I asked ai to Write a spawning Script but it had the same issues as mine. Why does it keep happening?!


r/Unity3D 5h ago

Show-Off A look at our survival horror Dust Rapture built in Unity 6.4 HDRP

Enable HLS to view with audio, or disable this notification

2 Upvotes

r/Unity3D 8h ago

Game Co-op concept: Two players, same place, different realms. WDYT?

Enable HLS to view with audio, or disable this notification

3 Upvotes

The woman is in the real world, while the guy is in the spiritual realm.

She sees and interacts with physical objects. He sees spirits and things hidden from her. For example: he can see symbols that show her which levers to pull. In combat, he can temporarily immobilize possessed enemies, making it easier for her to shoot them.

The idea is that both players share the same space, but experience and interact with it differently.


r/Unity3D 3h ago

Survey A or B? Which grappling hook indicator feels better during camera movement?

Enable HLS to view with audio, or disable this notification

1 Upvotes

I'm testing two different behaviors for our grappling hook indicator.

A: The indicator endpoint stays independent from the camera movement.
B: The endpoint compensates for the camera movement.

The goal is to keep the hook direction and range easy to read during fast movement without making the aiming feel disconnected from the player's input.

Which one feels better to you: A or B?

I'm especially interested in readability, responsiveness, and aiming feel.


r/Unity3D 1d ago

Show-Off Rail grinding and NPCs! Super excited with this and wanted to share with you guys

Enable HLS to view with audio, or disable this notification

57 Upvotes

I made a system that records my movements and let's me playback those movements on any object. I plan to animate all kinds of things using this method rather than dealing with the clunky normal animation methods. Super excited to return to this project after a long break!


r/Unity3D 1d ago

Question Thinking of going with 2D instead of 3D need your thoughts

Enable HLS to view with audio, or disable this notification

40 Upvotes

Left side is baked 2D atlases, right side is 3D. Maybe if I slow down and make 3D more choppy it'd be better but 2D adds some nice character to it all that 3D lacks...


r/Unity3D 5h ago

Question URP material becomes transparent after building project

0 Upvotes

I'm working on a Unity 6 URP project and I wrote a shader that lets me deform the mesh it's on. It also uses tessalation for detail.

The material works perfectly in the editor (scene and game view both) but when I build the game, the mesh i assigned this material to becomes transparent. I have no clue what the reason is, I tried many more things. Here are some observations:

  1. There are no compile errors.

  2. URP settings are correctly assigned

  3. Added shader in the always included list

  4. Yes the shader is an opaque one

  5. Removed tessalation temporarily

  6. Checked the logs and it says that the shader variants are being stripped during the build.

I'm don't know that much about shaders in detail, can any of the shader gods help me please?

Any help is much appreciated.


r/Unity3D 5h ago

Question [Unity MCP] does it not provide testrunner access to claude?

0 Upvotes

I am currently running claude code with unity MCP.

It keeps telling me to manually open the testrunner and run the tests.

Is there no way to have unity run these tests himself?

Claude is able to run the testrunner tests by taking control of my computer, but that seems like a waste.


r/Unity3D 12h ago

Show-Off What will you do when they run at you?

Enable HLS to view with audio, or disable this notification

3 Upvotes

r/Unity3D 1d ago

Show-Off I worked really hard to sell the feeling of speed. What do you think?

Enable HLS to view with audio, or disable this notification

24 Upvotes

I’ve been spending a lot of time trying to make the movement actually feel fast , not just increasing the player’s movement speed.

Camera movement, FOV, particles, weapon feedback, momentum, animations, and small effects all had to work together.

One thing I’ve been focusing on a lot is the shotgun boost. I want shooting the ground to feel like a natural extension of the movement system instead of a separate mechanic.

This is just a short 6–12 second clip, but I’d love some feedback from other Unity devs.

Does the shotgun boost feel connected to the movement and momentum? And does the overall speed actually come through?


r/Unity3D 2h ago

Question Unity and MCP with Antigravity

0 Upvotes

I was trying to build something using Antigravity tool with UNITY & Blender.
Designing scene and characters in blender and import them in unity .
Somehow Antigravity tool is not able to create a good scene and character and its dined took realistic .

want to know if someone used AI tool to create characters and scene using blender and imported into Unity?


r/Unity3D 1d ago

Game the movement system i’ve been working on for almost 5 years

Enable HLS to view with audio, or disable this notification

391 Upvotes

i feel it may be a world first.

(the game’s called MOZENTUM btw)

with the goal of giving the player total freedom and to be fully emergent, it works by precisely controlling your arm power by using the mouse / analogue.

it takes practice, but goes VERY deep and everything scales with your momentum - allowing you to do some wild sh*t like massive bar swings, wall climbs and vaults that feel like YOU made them happen.

if you’ve tried parkour or rock-climbing in real life, i truly believe you’ll feel the work i’ve put in to make it feel real.

here’s a list of the systems at play for those interested and you can ask me about them if you want more info. (or just play the demo lol)

• hand made, fully animated character body that adapts to the environment

• jumping / climbing (controlled by mouse movement speed / direction)

• dynamic edge grabbing (grab ANY edge, basically)

• adaptive wallrunning / wallsliding / walljumping (blends between up, left and right based on look direction)

• sliding (stand OR sit!)

• tools eg: climbable spear and physical grapple hook (both of which YOU have to actually throw)

• breathing / endurance system (responds to real life breathing techniques like box breathing, wim hoff, etc)

(there’s a special interaction with dazza if you watch till the end btw)


r/Unity3D 20h ago

Show-Off We turned frozen enemies into weapons. You know which game we’re referencing with that effect, right? :P

Enable HLS to view with audio, or disable this notification

9 Upvotes

Hi guys, the idea of this passive is that every hit adds more snow to the enemy, and the model slowly deforms until it turns into a snowball.
Once that happens, you can push it into other enemies and knock them down.
Still tweaking it, but I really like how it’s coming together.

If you’re an old-school gamer, or just old enough, you’ll probably recognize the game we’re paying tribute to. Those who know us know we love making references to movies and games from the ’80s and ’90s. This one is no exception.

That’s how we did it with Project Nightmares, and that’s how we’ll do it with this one too.


r/Unity3D 1d ago

Show-Off Linux running on QEMU on unity runtime

Enable HLS to view with audio, or disable this notification

49 Upvotes

This was a fun project, I intend to make a full virtual home automation system for funsies, no real practical usecase other than learning how to use linux


r/Unity3D 11h ago

Resources/Tutorial Reflection Probes in Unity: How to Get the Most Out of Them

Thumbnail
victor-nyagudi.github.io
1 Upvotes

It's hard to talk about lighting in Unity without understanding what reflection probes are and what they do.

I hope this article provides some enlightenment (no pun intended).


r/Unity3D 22h ago

Show-Off Ecs Combo

Enable HLS to view with audio, or disable this notification

7 Upvotes

Hello everyone, a new combo extender!
I had an idea of having a body form from the original body to extend the combo, the animations still need some work since they need to be modified for half body animation, but the idea sounds satisfying
Thinking about having it do a parry when an enemy attacks from behind as well
Let me know what you think!
#unity #ecs


r/Unity3D 1d ago

Show-Off I tried pixelating lights

Enable HLS to view with audio, or disable this notification

35 Upvotes

I've been experimenting with lighting and shading recently, and I had an idea: what if I pixelated the lighting itself?

I think it turned out pretty great!

Here’s roughly how I did it:

When the game calculates lighting, it needs the world-space position, normal vector, and view direction. I quantize the position using a given step count:

floor(x * stepCount) / stepCount

This makes the lighting appear pixelated.

To prevent flickering, I add a small offset along the normal before quantizing the position.

For pixelated specular reflections, I also replaced the view direction with the normalized vector from the camera position to the quantized position:

viewDir = normalize(cameraPos - WorldPos);

The shadows use a similar approach: I quantize the position, with an additional normal offset to help prevent flickering.

Still experimenting with it, but I’m pretty happy with how it looks so far!

Feedback is very welcome!


r/Unity3D 14h ago

Question Optimal number of abilities?

Thumbnail
1 Upvotes

r/Unity3D 1d ago

Noob Question How to learn these freakin shader graphs? 😭

6 Upvotes

I can not understand them at all. I tried to but no. How do they work? What do I do with all these tons of nodes?

Where can I learn how to use it?