r_unity3d | Unsorted

Telegram-канал r_unity3d - r/Unity3D

156

News about the Unity engine and project showcases from Reddit. Made possible with @reddit2telegram (@r_channels).

Subscribe to a channel

r/Unity3D

Procedural hex world-builder in Unity. Part 2

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

Читать полностью…

r/Unity3D

Sci-fi UI coming together
https://www.reddit.com/gallery/1spsfxd

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

Читать полностью…

r/Unity3D

Not sure how to fix this error message

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

Читать полностью…

r/Unity3D

Stop wasting time on UI setup—Free tool for auto-generating Prefabs with 9-Slice and Buttons.
https://youtu.be/TnSpFsWFlZ0

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

Читать полностью…

r/Unity3D

PrimeTween PRO · Code-Free Animations

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

Читать полностью…

r/Unity3D

Free Textures Mix Stones & Lava

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

Читать полностью…

r/Unity3D

How can I create multiple cities on one terrain? Do I need to downscale the 3D models?
https://redd.it/1spivtp
@r_Unity3D

Читать полностью…

r/Unity3D

In honour of Portal 2's recent birthday, here's a prototype portal space game I kit-bashed for a game jam a little while back

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

Читать полностью…

r/Unity3D

10 Mistakes I Made Learning Unity Alone (Cost Me Years)
https://darkounity.com/blog/10-mistakes-i-made-learning-unity-alone-cost-me-years

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

Читать полностью…

r/Unity3D

I replaced OnDrawGizmos function with a custom GPU instanced Gizmos system to avoid the main thread sequential execution for my BVH implementation with my virtual geometry system.
https://redd.it/1sp9vnq
@r_Unity3D

Читать полностью…

r/Unity3D

Waterfall Before/After

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

Читать полностью…

r/Unity3D

Level prototype vs finished level in our racing-platformer (Unity 6.3 URP)

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

Читать полностью…

r/Unity3D

Just built a tool to take these zoomed out screenshots of my 2D mining game

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

Читать полностью…

r/Unity3D

New skill learned: "Water Buoyancy"

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

Читать полностью…

r/Unity3D

Some bloopers while training my robot to walk. He definitely needed a toilet break.

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

Читать полностью…

r/Unity3D

Pixel Art Item pack 32x32
https://redd.it/1spsalc
@r_Unity3D

Читать полностью…

r/Unity3D

Why Is My Circular Mask Only Clearing a Ring (Donut Shape) in Unity 2D?

Hi there,

I’m currently working on a feature in my game where the player can clear a circular area within a 2D sprite. The functionality is almost working as intended, but I’m running into an issue: instead of clearing a full circle, it only clears a donut-shaped ring (the center remains unaffected).

At the moment, I’m using Unity’s Unlit/Transparent shader to perform the clearing, but it seems this approach might not be suitable for achieving a solid circular result. I suspect I may need a custom shader, though I don’t have much experience with shader development.

Here’s a short video demonstrating the issue for better clarity:

[https://youtu.be/xMcfdo25tf8](https://youtu.be/xMcfdo25tf8)

Here’s the main code I’m using:

public void PaintAtUV(Vector2 pos)
{
GetSpriteUVAtWorldPos(pos, out Vector2 uv);
RenderTexture prevRT = RenderTexture.active;
RenderTexture.active = maskRenderTexture;
GL.PushMatrix();
GL.LoadPixelMatrix(0, maskRenderTextureSize, maskRenderTextureSize, 0);
float px = uv.x * maskRenderTextureSize - halfAdjustedBrushSize;
float py = (1f - uv.y) * maskRenderTextureSize - halfAdjustedBrushSize;
Graphics.DrawTexture(new Rect(px, py, adjustedBrushSize, adjustedBrushSize), brushTexture2D, brushMat);

GL.PopMatrix();
RenderTexture.active = prevRT;
}

And here’s another section from the same script that may help provide context for the function above:

[SerializeField] private Material revealMaterial; // Terrain 2 material
[SerializeField] private Texture2D brushTexture2D;
[SerializeField] private Material brushMat;
[SerializeField] private SpriteRenderer spriteRenderer;
[SerializeField] private float brushSize;
private RenderTexture maskRenderTexture;
// private readonly int MaskTexID = Shader.PropertyToID("_MaskTex");
[SerializeField] private Transform spriteTransform;
private Sprite sprite;
private Vector2 spritePivot;
private float spritePpu;
private float adjustedBrushSize;
private float halfAdjustedBrushSize;
// private float adjustedBrushHeight;
private int maskRenderTextureSize;

void Start()
{
// Create mask RenderTexture
maskRenderTextureSize = 512;
maskRenderTexture = new RenderTexture(maskRenderTextureSize, maskRenderTextureSize, 0, RenderTextureFormat.Default);
maskRenderTexture.Create();
sprite = spriteRenderer.sprite;
spritePivot = sprite.pivot;
spritePpu = sprite.pixelsPerUnit;

// Clear mask to white
RenderTexture prevRT = RenderTexture.active;
RenderTexture.active = maskRenderTexture;
GL.Clear(true, true, Color.white);
RenderTexture.active = prevRT;

// Assign mask to shader
revealMaterial.SetTexture(Shader.PropertyToID("_MaskTex"), maskRenderTexture);

adjustedBrushSize = brushSize / spriteTransform.lossyScale.x;
halfAdjustedBrushSize = adjustedBrushSize * 0.5f;
}

void GetSpriteUVAtWorldPos(Vector2 worldPos, out Vector2 uv)
{
Vector2 localPos = spriteTransform.InverseTransformPoint(worldPos);

// Convert to UV coordinates
uv = new Vector2(
(localPos.x * spritePpu + spritePivot.x) / sprite.rect.width,
(localPos.y * spritePpu + spritePivot.y) / sprite.rect.height
);

// return uv.x >= 0f && uv.x <= 1f && uv.y >= 0f && uv.y <= 1f;
}

brushMat:

https://preview.redd.it/or7okmsnc5wg1.png?width=585&amp;format=png&amp;auto=webp&amp;s=74f757a89502c12a884945ab33689ac425185260

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

Читать полностью…

r/Unity3D

Unity IK LookAt Script for More Natural Character Attention
https://redd.it/1spvfnv
@r_Unity3D

Читать полностью…

r/Unity3D

Finally understood Animator parameters after messing it up for hours

I kept getting stuck trying to switch between idle and walking animations cleanly.

The thing that finally clicked was using parameters properly (bools + floats) instead of trying to brute force transitions.

Biggest mistake I made was not separating movement logic from animation states.

I put together a quick walkthrough of how I set it up if anyone else is stuck:
https://youtu.be/l0-l-DwDIxs

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

Читать полностью…

r/Unity3D

I made a major update !!

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

Читать полностью…

r/Unity3D

Ash & Iron Progress Update

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

Читать полностью…

r/Unity3D

Is My Physics Puzzle Game Actually Fun? Need Playtesters

Hey everyone!

I’m currently working on a mobile physics-based puzzle game and have built a small prototype with 10 levels to showcase the core gameplay.

Right now, I’m mainly trying to figure out whether the core gameplay loop feels engaging and fun. If anyone is interested in playtesting and sharing honest feedback, I’d really appreciate it just drop me a message!

Also, if you’re someone who’s planning to create a physics-based puzzle game as well, I’d be open to collaborating and building something together.

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

Читать полностью…

r/Unity3D

Creating My Own city

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

Читать полностью…

r/Unity3D

Wonky movement with Mixamo model and animations

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

Читать полностью…

r/Unity3D

I highly value your insights and recommendations.😊

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

Читать полностью…

r/Unity3D

Making PS1 games in Unity is now possible
https://redd.it/1sovkr4
@r_Unity3D

Читать полностью…

r/Unity3D

A few screenshots of my upcoming horror game made with unity

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

Читать полностью…

r/Unity3D

Multiplayer for card games and similar genres in Unity

Usual options are full on custom Game server (time heavy), Mirror or similar frameworks force you for one game server per match (expensive), simple Relays (hackable easily).

So I created a specialised Turn based Relay, it enforces turns and hides hands so speeds up building games. Handles reconnecting. But also has client voting concensus, so although it doesnt know your game rules it enforces game end or skipping turn if clients vote its illegal.

API is very simple, 70 lines full multiplayer game with matchmaking and everything. If you would like to try demo or sign up its here: https://www.turnkit.dev/live-demo, Also added Leaderboards, so relay match results can be vetted by players in that match.

Is the idea interesting? Which features would you want if you are making turn based game?

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

Читать полностью…

r/Unity3D

This is my first game, after many revisions thanks to everyone's feedback and suggestions.
https://www.youtube.com/watch?v=ezBO3ozweFs&amp;t=12s

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

Читать полностью…

r/Unity3D

Added a new respawn… but it slowly kills your base each time
https://redd.it/1sovpys
@r_Unity3D

Читать полностью…
Subscribe to a channel