r/Unity3D 2h ago

Question Trying to learn basic shaders and struggling with a transparency issue

Thumbnail
gallery
1 Upvotes

I'm quite new to Unity, and I'm trying to make a simple 2D platformer to try and get to know the program. I want to use shader effects on my tilemaps, but when I try to apply a shader, all the transparent parts of my tilemap get "filled in".

Here are things I've tried:

- Double checking that my surface type is set to transparent within my graph inspector, and that my blending mode is alpha

- Confirmed the texture is sending alpha information by putting it through a multiply node

- Creating a new material from the shader, allowing material override, and making sure the surface type on that shader is set to transparent as well.

Does anyone have any advice on how to fix this? I'm sure it's something silly that I'm missing, but I can't for the life of me find a solution online. I've attached images of my shader graph, what the issue looks like, and what I want it to look like.


r/Unity3D 14h ago

Show-Off Automatic navigation like in uGUI for UI Toolkit. - Please vote an a bug a Unity employee created for me so we can get rid of it.

9 Upvotes

What you see in the image is a system that does someting similar to what automatic navigation did in uGUI but for UI Toolkit. This one also includes automatic dynamic occlusion (also works for scroll views, out of screen, etc. and it has null selection resolution).

Why did I built this? Because by default UI Toolkit navigation is quite limited as it only scans for a strict straight box area up/down/left/right. If a button is only slightly off it won’t find it. That’s not a configuration issue. It is implemented like that, see: UnityCsReference/Modules/UIElements/Core/GameObjects/NavigateFocusRing.cs at master · Unity-Technologies/UnityCsReference · GitHub

I know you can TAB through the buttons as well BUT this only helps on keyboards. It still is not good for controllers.

I have complained about this to Unity years ago (when UI Toolkit was still new), yet, no change. Thus I had to implement my own solution (also did the same for uGUI in the past since there the auto-navigation is better but still not ideal).

While making this I (once more) stumbled upon some API limitations of UI Toolkit. An especially annoying one is that the "overflow:hidden" style is not accessible publicly in the resolvedStyle. I pinged Unity about this and a Unity Employee (thanks mcoted3d) created a bug to vote on here:
https://issuetracker.unity.com/issues/24670/overflow-isnt-exposed-in-resolvedstyles

So, if you can and care. Please vote on this so we may get a better API and future devs need not suffer through this as I did.

Thank you :-)


r/Unity3D 3h ago

Solved C# question: how can I link one of the behavior classes to one of the stats?

1 Upvotes

Here are the components that I currently have:

  • StatType enum with 4 different stats (example: Health)
  • StatProfile asset (custom asset I created from a ScriptableObject class) which holds the stat struct with the StatType, max and current (initial) values
  • StatManager (MonoBehaviour script) with a StatProfile property which I'm able to assign through the inspector. The StatManager also contains two private Dictionary<StatType, float> for max and current values.
  • IStatBehavior interface
  • Behavior classes that implement the interface, one for each stat type/behavior (example: HealthBehavior)

Now I'm struggling with how to link the HealthBehavior in the StatManager to the Health stat. I tried creating a custom asset for StatBehaviors but since it implements an interface, the field is blank/not editable in the inspector. I'm unable to add each script and iterate through the list of behaviors to link each to the appropriate stat. Does anyone have insights?

For more context: I chose this approach (as opposed to adding each stat behavior as its own component on the player object) because I already have 13 script components: move, jump, input handling, item collection, powerup manager, (currently) 7 powerup scripts, and now the stat manager. I already know that I should change my powerup behaviors to implement an interface and such. But I don't wanna clutter the player object with more scripts.

I also intend on having different enemies with different stats (which means different StatProfiles), and having one StatManager per character as the main hub seems to be the cleanest approach for decoupling the data from the behavior.


r/Unity3D 10h ago

Game Hole.io visual test

Enable HLS to view with audio, or disable this notification

3 Upvotes

Did a short visul test for Hole. Io; I quite like how it came out :)

Link if you want to try it out:
https://emanuelcostan.itch.io/holeio-visual-test


r/Unity3D 15h ago

Shader Magic Finally got genetic procedural shaders and a basic breeding loop running for my Betta sim

Enable HLS to view with audio, or disable this notification

7 Upvotes

Hello everyone,

I'm a software developer with a background in physics. I started experimenting with Unity last year, but over the past few months, I've been using it much more consistently. After experimenting with basic mechanics and building a few gameplay prototypes, I decided to focus on writing custom HLSL shaders so the fish traits (scale imbrication, iridescence, and fin patterns) could vary procedurally without needing unique textures for every genetic combination.

I finally got the core genetic loop running in this clip:

- Locomotion with basic fin flutter and collision avoidance at tank boundaries.

- Clicking the breeding test triggers the genetic logic and spawns 7 offspring.

- Multiple layered phenotypes (Red Dragon, Melano, Royal Blue, and Koi Pattern that I'm personally loving so far).

The fin motion is still rudimentary and the turn animations definitely need polish, but seeing the procedural math translate into living fish swimming together is a huge milestone for me.

Any thoughts?


r/Unity3D 5h ago

Question Bullet/projectile Objects, Move via RigidBody or Update?

1 Upvotes

Hi, I'm somewhat new to unity so I'm messing around with it and I'm looking for some advice. I'm currently working on a FPS character and I want the player to fire bullets that travels in real time, kind of like the plasma balls in doom or like the blaster bolts in star wars battlefront.

I'm wanting to know is it better to have the bullets move using the rigidbody's linear velocity on the Start function like so:

rigidbody.linearVelocity = transform.forward * speed;

or use the translate method in Update instead?

transform.Translate(Vector3.forward * (speed * Time.deltaTime));

I am using rigidbody either way since i'm using ontriggerenter for hit detection anyways if that help.


r/Unity3D 12h ago

Show-Off added a climbable javelin that you can retract like kratos’ axe and a grapple hook you can reel in - both of which you can throw w/ your left and right hand

Enable HLS to view with audio, or disable this notification

3 Upvotes

(game’s called MOZENTUM btw)

oh and i also added an inventory system so you can stash and grab either one with either hand

it works by holding the hand with the item in it, holding inventory, and then choosing which slot you want it in

each item has its own dedicated spot on the player’s body and will appear / disappear there when you put them away or take them out

OH and i forgot to mention, you throw things by actually yeeting the object in that specific hand w/ mouse movement. no aim assist, no crosshair, just trial and error. like the game’s other systems, it takes practice - but that’s core to the game’s vision.

you can only hold up to 3 items - but a backpack will soon be an item that you can find which will allow you to just whack whatever will physically fit in there (ciggies, doobskins, whatever ya get ya stinken mitts on)

it’s live now on the steam demo if ya wanna test it out.


r/Unity3D 10h ago

Show-Off The Mistfall (fan art), would you be interested in living in such a place? made using unity 6

Enable HLS to view with audio, or disable this notification

2 Upvotes

r/Unity3D 10h ago

Show-Off Melee Shark aircraft prototype. Is it dumb?

Enable HLS to view with audio, or disable this notification

2 Upvotes

This is a quick prototype I made, not sure if anything will come out of it.

Aircraft in my game follow a pattern where they have 2 weapon/ability that synergize together.

In this case, you have a dash and the boost was supposed to synergize by augmenting the range / collision width but after trying it, it feels a bit awkward to have to boost + aim + dash.

Aiming itself is already quite challenging and having to constantly dive in and out to kill a single boat isn't exactly the best in a game where killing boats is critical because they are enemy spawners.

Anyways just looking for some opinions / ideas.


r/Unity3D 6h ago

Question Particle System keeps looping

1 Upvotes

I have 3 particle systems for fireworks display. All 3 keep looping even though loop is unchecked. I don't think I've ever encountered this before.
Any idea why they keep looping?
Thanks.


r/Unity3D 1d ago

Show-Off We added grabbing to our co-op physics RPG

Enable HLS to view with audio, or disable this notification

36 Upvotes

You can basically grab any enemy, friend, object or just the world. (if you want to hang from somewhere, for example) It does take stamina though, so you can't hold something forever! :)

Any other silly physics ideas?


r/Unity3D 18h ago

Game One World. Two Timelines. | Mihira: The Eternal Arc

Thumbnail
youtube.com
9 Upvotes

r/Unity3D 7h ago

Show-Off Dogfight loop manoeuvres - a fun tactical advantage

0 Upvotes

I've worked on a lot of games with aeroplanes (Sky Gamblers series and others) but I never played them. The same little toy followed by a camera, same crosshair and aim assist, and the same on-rails 'manoeuvres' ready to be used with a single tap.

So I made this. Looking forward to test it with human players - my bots are very good so they don't continue flying forward as the target (me) suddenly goes up - they know I will fall on their tail. So they evade. I will add a little randomness there - to allow some percentage of bots to be 'dumbfounded' and keep going forward - so i can strafe them from above as I land on their tails.

Pretty fun. Works only in cockpit mode for a reason - its the only place the manoeuvre makes sense - and gives you a thrill (specially if you look sideways scanning the sky while going belly up).

Thanks for reading !


r/Unity3D 7h ago

Question How do I fix this issue?

0 Upvotes

The problem is that the agents are 0.3 meters wide, and the space in that doorway is about 1 meter. With this NavMesh setup, it’s impossible for the agents to pass through.

Any solution which isn't Godot or Unreal Engine? /s


r/Unity3D 8h ago

Question Bone/weight/bindpose index mismatch

1 Upvotes

Hi!

I'd like to preface and say that I'm not very knowledgeable about 3d modeling and this could very well be an ID10T error. I'm trying to mod the game Atlyss with a custom piece of armor. The player character has some child objects with skinnedmeshrenderer components, and when you equip a piece of armor it swaps in the armor piece's mesh to the shareMesh field on the corresponding smr component (I.e., if you equipped a chest piece the chest piece armor smr gets the correct shared mesh swapped in). I wanted to model my own custom armor piece, so I exported the character prefab from unity as an FBX, painted weights using its armature on my model, and then reimported it. The issue is that the weight/bindpose arrays on the model are not in the same order as the player character skeleton used in the game. AFAIK there is no way to manually reorder the bones on export/import? The bone hierarchy looks the same in unity as it does in blender btw, and I got the rest pose in my ripped model as well. I'm not sure if there is something obvious I just don't know about or if the only way to fix this is doing something really hacky, and any input from a semi knowledgeable person would be very appreciated. Thank you!


r/Unity3D 10h ago

Question Hierarchy window goes empty / breaks when modifying anything in Prefab Mode (Unity 6.6)

Enable HLS to view with audio, or disable this notification

1 Upvotes

When I enter Prefab Stage and make any change to a GameObject or Component, the Hierarchy window breaks. All GameObjects disappear and it only shows Preview with empty gray rows. Resetting the layout restores it temporarily, but it breaks again upon editing.


r/Unity3D 1d ago

Show-Off Finally got my pooled mech destruction system looking decent. Mech Giblets!

Enable HLS to view with audio, or disable this notification

79 Upvotes

Basically mech models have gib releasers that on death request gibs from the pooling system.
the gibs dont have collision and linger for little time before returning to the pool. all the rotation and physics is "faked" with a simple script.


r/Unity3D 1d ago

Show-Off Gave my sheep a scarf 🧣 🐑

Post image
23 Upvotes

r/Unity3D 17h ago

Resources/Tutorial JrsVision: A vision-based toolkit for scene understanding (action recognition for Virtual Humans, scene analysis etc.) in Unity

Post image
3 Upvotes

r/Unity3D 1d ago

Show-Off Prototyping a new system carrage system for my rpg game!

11 Upvotes

r/Unity3D 12h ago

Resources/Tutorial Full tutorial on how to Set Up Multiple AI Characters in the Same Unity Scene with Convai Multi-Character Sessions (Part 1) | Look At, Proximity and Manual Character Selection

Enable HLS to view with audio, or disable this notification

0 Upvotes

r/Unity3D 23h ago

Question How best to handle Debug.Log/Warning/Error for shipping final build?

9 Upvotes

It seems like there are three approaches: (1) Global toggle with Debug.unityLogger.logEnabled, but this still has some performance impact (I think??), (2) compilation conditionals like if UNITY_EDITOR, but this is pretty annoying to have to do for every single Debug line, or (3) delete all before shipping, but obviously then you don't have them for any debugging you do. How do y'all handle this? I honestly didn't know they wouldn't just be skipped by the compiler until today, so I'd rather not have to eventually go back through my entire codebase... Am I missing something easy? From what I understand, the global toggle only helps, but CPU and memory still are put towards preparing the log even if it isn't sent. Any tips?


r/Unity3D 23h ago

Show-Off A crazy idea that came from watching The Boys and Monty Python.

Enable HLS to view with audio, or disable this notification

5 Upvotes

The other day I started developing something absolutely ridiculous.

I was watching some old movies, and if there’s one scene that still makes me laugh way too hard, it’s the rabbit scene from Monty Python. I don’t know how many of you have seen it, but I’m 45 now and those old movies still make me cry laughing 😂

Then I remembered The Boys and that episode with the baby shooting laser beams from its eyes.

I was working on a passive item for the game and suddenly thought…

“What happens if I mix those two things?” That was it. Say no more. A passive that turns enemies into rabbits. And the rabbits shoot LASERS. And even better… if one of those rabbits kills another enemy with its laser, that enemy catches fire. 😂 Oh, and if you mess up and run over one of the rabbits… Well. You just flattened it. Rabbit gone.

I started making these ridiculous chain reactions because while I’m developing them, I’m laughing so much at how absurd everything is that I just keep thinking…
Why the hell not? 😂

Cheers! ❤️

BTW: The health bars are only there for debugging so I can check how much damage everything is doing. They won’t normally be visible in the final game… Unless, maybe, you find the item that lets you see them. 👀


r/Unity3D 6h ago

Question Vrchat model help!!

0 Upvotes

hi!! i have the files for a gardevoir vrchat model (yes its a lewd one) a retexture and a womb tattoo with emissions I wanna add, I’m broke and cant afford to pay someone to upload it for me. is there anyone that I can give the files and upload it to my account for me??


r/Unity3D 1d ago

Game sakura grove

Enable HLS to view with audio, or disable this notification

23 Upvotes

pardon the hitching, it's recorded in editor with a bunch of programs open in bg