r/Unity3D – Telegram
r/Unity3D
260 subscribers
12.6K photos
15.5K videos
14 files
47.8K links
News about the Unity engine and project showcases from Reddit. Made possible with @reddit2telegram (@r_channels).
Download Telegram
I'm currently having an issue programming a multiplayer game that uses two controllers.

I'm trying to program a two player multiplayer game that uses two controllers; one per user. However, when I tried to control the first player with a singular controller while having both controllers plugged in, the controller ended up controlling both players while the other controller plugged in doesn't do anything.

I tried implementing this idea by creating two separate noscripts that handles user input and assigns a controller to their designated player gameobject's .

The following is player one's noscript, where its controller is assigned

public int playerIndex = 0;
private Gamepad assignedGamepad;
void Start()
{
// Assigning Controller To The Player
var gamepads = Gamepad.all;
if( playerIndex >= 0 && playerIndex < gamepads.Count)
{
assignedGamepad = gamepadsplayerIndex;
}
}

The following is player two's noscript, where it's controller is assigned

private Gamepad assignedGamepad;
public int dioIndex = 1;
void Start()
{
var gamepads = Gamepad.all;
if (dioIndex >= 0 && dioIndex < gamepads.Count)
{
assignedGamepad = gamepadsdioIndex;
Debug.Log("Player 2 is connected");
}
else
{
Debug.LogError("Player 2 isn't connected");
}
}

https://redd.it/1hxskha
@r_Unity3D
This media is not supported in your browser
VIEW IN TELEGRAM
When you learn to make a character move for the first time, but it’s not exactly what you wanted.

https://redd.it/1hxla93
@r_Unity3D
Put my game down for a week or two to take a break, and came back to a new bug. Both enemies and Player are doing damage just by looking at each other, and I can't figure out what changed? I didn't touch the code for these and it was working before. Anyone have any ideas?

https://redd.it/1hxvlda
@r_Unity3D
Unity Overlap Painting

Hi, I’m looking for a specific shader in Unity that would allow me to paint on a plane during runtime, similar to painting on a canvas.Here’s the behavior I’m aiming for:

I have three colors in the palette: the default color (the base color of the plane), and two brush colors (blue and yellow).
When I paint over an area that has already been painted, the spot will change to the new color, but the previous color will remain active, so I can continue painting with it elsewhere. In other words, if I paint the same spot twice, the spot’s color will update to the new one, while the previous color is still available for further painting.

Previously, I attempted to paint using meshes (connecting triangles to form the brush shape), but I couldn't figure out how to update the color when painting over the same area.If anyone knows of an asset or a method to achieve this effect, please let me know. I’d really appreciate any help!

https://redd.it/1hxtvz3
@r_Unity3D
This media is not supported in your browser
VIEW IN TELEGRAM
If you hate coding or designing UI like I do, I have found this awesome free UI resource in Unity Store.

https://redd.it/1hxj6sk
@r_Unity3D
This media is not supported in your browser
VIEW IN TELEGRAM
Don't mind me, just having fun exploding my balls with DOTS Physics :]

https://redd.it/1hxy4xl
@r_Unity3D
Crazy amount of shader bloat in Unity 6?

I've noticed my Quest 2 builds breaking in Unity 6.

When I have 6 level of graphical settings, Unity actually appears to compile every single shader combination for every possibly URP graphical setting that can happen at runtime.
For example, if you switch terrain holes on, I believe it instantly doubles the number of shaders you have. Now, with 6 GB of ram, the game OOMs (out-of-memory) on scenes containing only 3 1024x1024 textures (!!)

When I cut out all but the lowest quality setting on my game (which really only has one quality setting on Android), as much as 400MB was cut from the build). I still see 23,000 shaders being compiled on build.

Does Unity actually have to load EVERY SINGLE SHADER combination at runtime? It's quite honestly quite ridiculous. I believe many other engines simply load only the shaders for the current graphical setting at runtime, and reload the game when you opt to change graphical settings?

My windows builds which do have higher graphical settings now actually take longer to boot even on an SSD with a Geforce 4070 Ti than my Quest builds, and it looks like the engine compiles 230,000 variants of the Simple Lit shader (!!)

https://redd.it/1hxx3ba
@r_Unity3D
Combat Improvements for my Soulslike game Trial by Fire.

https://reddit.com/link/1hy0egr/video/mch8f03st4ce1/player

Added quite a lot of new stuff and polished existing systems. Also did the first network test with a friend of mine and must say that most things work great, but some effects and sounds are not yet synced over the network. That will be a task for the coming days. Here's a list of things I did last week:

Reduced number of i-frames for the roll
Created better hit colliders so attacks can miss if not properly timed
Changed the environment (again...)
Footsteps on different surfaces and these are synced over the network
New model for the player
Aggro system for the enemy, it will attack the one dealing most damage (will incorporate more factors later)
Heavy attack for both the enemy and player
Hit react / Knockdown (after heavy attack) effect on enemy
Hit react resets basic attack cooldown
Knockdown will taking longer for enemy to recover

I'm going to work on a ranged type of enemy and syncing effects and sounds across the network.

https://redd.it/1hy0egr
@r_Unity3D
Media is too big
VIEW IN TELEGRAM
Latest work on procedural planets, with dynamic planetary water, volumetric clouds and atmosphere, screen space shadows on ground by clouds and dynamic weather effects

https://redd.it/1hy2igk
@r_Unity3D
Hey! I’m working on survival horror game called Becrowned. If you’re into industrial horror and dark fantasy, make sure to add my game to your wishlist!

https://redd.it/1hy5gba
@r_Unity3D