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

So my hobby for my first try at gaming Dev...

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

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

r/Unity3D

For hexagonal buttons on a canvas in a scrollview, how can I prevent the overlapping invisible corners from blocking each other
https://redd.it/1tn4eaw
@r_Unity3D

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

r/Unity3D

Making a desert green

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

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

r/Unity3D

What camera setting should be default, A or B?
https://imgur.com/a/PDknE2H

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

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

r/Unity3D

Bizzare, inconsistent behaviour from RaycastHit.normal

Hi all,

I'm working on a custom collision system that relies a lot on raycasts at the corners of each moving entity (the game is from a side perspective, not top-down). In the course of doing this, though, I've come across a weird problem. I want to check if my downwards collision check is perpendicular to the surface it's hitting, so I don't "rub" against walls on the way down, resetting vertical speed. This, for some reason, works on the right walls but not on left walls. Here's a code snippet:

hit1 = Physics2D.Raycast(brCorner + new Vector2(hSpeed, 0f), new Vector2(0, -1), -vSpeed + 0.1f, myMask);
hit2 = Physics2D.Raycast(blCorner + new Vector2(hSpeed, 0f), new Vector2(0, -1), -vSpeed + 0.1f, myMask);

Debug.Log(Mathf.Atan2(hit1.normal.y, hit1.normal.x) Mathf.Rad2Deg);

Debug.Log(Mathf.Atan2(hit2.normal.y, hit2.normal.x)
Mathf.Rad2Deg);

if (hit1.normal.y != 1 && hit1)
{
hit1 = new RaycastHit2D();
}
if (hit2.normal.y != 1 && hit2)
{
hit2 = new RaycastHit2D();
}

hit1 = Physics2D.Raycast(brCorner + new Vector2(hSpeed, 0f), new Vector2(0, -1), -vSpeed + 0.1f, myMask);
hit2 = Physics2D.Raycast(blCorner + new Vector2(hSpeed, 0f), new Vector2(0, -1), -vSpeed + 0.1f, myMask);

Apologies for the way this is written lmao. The Raycasts are offset by the hSpeed (horizontal speed) to prevent corner clipping, but I don't suspect this matters. brCorner and blCorner are bottom right and bottom left of the collision box. Anyways, the Debug logs semi-consistently correctly return a 0 degrees when I jump into a right wall (but occasionally throw out a 90 for some reason), but when I jump into a left wall, I almost always get a 90 degrees, and my falling is stalled. I consistently check this midair, in the dead center of the walls, so there is no risk of it somehow accidentally tapping the bottom of the wall boxes I have set up. I have no idea how this kind of thing happens. All help is appreciated. Let me know if more code context is needed to solve this problem.

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

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

r/Unity3D

Is palette-based animation (or something similar) with Unity possible?

This seems super complicated to explain so I will try my best.

In the pixel game I'm making, the character is a pixel sprite of a guy wearing a sci-fi suit. When the character shoots, I want energy from the lights to sort of stream away from the gun starting at the wrist area. This is easy to do in an idle animation, but I'm wanting the lights to fully finish their animation whether the player is jumping, running, or anything else. The only way I can think to do this (without having the world's largest animation spiderweb) is by somehow having a "palette index". This would mean that certain pixels of my sprite that are predetermined by me would change colors, one after the other, until the animation finishes. Each specified pixel is indexed to the color it needs to be per frame, meaning I don't have to actually draw out the frames of the lights streaming away from the gun in every fashion.

Essentially, the lights will run on their own "coroutine", following a 4 or 5 frame light pattern when the player shoots, but the animation of the lights can't be interrupted when the player's animation changes (e.g. switching states [jump to idle\] or switching animation frames [run 4 to run 5\])


Because the pixels are in different spots per each frame of any animation, the specific lights would have to be marked beforehand by me, indexed, and told when to change color, so it would involve reading the current frame an animation is on.

Does anyone know if there is a plugin for Unity that either is like this or can achieve my goal? Let me know if I didn't explain it properly.

I'm praying that I'm not describing a hypothetical plugin, because I would have no idea how to program that lol.

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

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

r/Unity3D

Stress-testing my voxel cleaning system

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

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

r/Unity3D

Rebirth - Official Trailer
https://youtube.com/watch?v=uKdzoRR_Aoo&si=hTifw0P7xetbXsJd

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

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

r/Unity3D

Built a simple goal net effect that cansimulate back and forth! Shaders are truly magic!!!

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

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

r/Unity3D

Why does every post feel pretextual?

This subreddit is honestly just a crappier version of steam greenlight at this point. Nobody cares about the engagement with their posts, they care about the (link to store page below) engagement. It's so transparent, can we just have a shill flare or something?

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

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

r/Unity3D

When should I start promoting my game and building a discord channel?
https://youtube.com/watch?v=cHDqejGoQkg&si=RlPAuEzBg9-3YbxM

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

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

r/Unity3D

Made a procedural underwater caustics shader for my 2D Unity game (no textures), wanted some feedback

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

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

r/Unity3D

transferring my game to Unity

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

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

r/Unity3D

Roast my game's look

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

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

r/Unity3D

Random.Range(minH, maxH);
        float randomS = Random.Range(minS, maxS);
        float randomV = Random.Range(minV, maxV);

        Color chosenColor = Color.HSVToRGB(randomH, randomS, randomV);

        skinnedMesh.material.SetColor(propID, chosenColor);
    }
}

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

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

r/Unity3D

Tilemap Collider Seems Shifted Up
https://redd.it/1tn6qb0
@r_Unity3D

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

r/Unity3D

A beginner game maker

I’m interested in creating a 2D game using Unity, but I’m a complete beginner when it comes to coding and have never worked on a project like this before. Could you please guide me through the process of getting started and learning how to code? What are the best practices and things to avoid? I’d appreciate any information you can provide to help me succeed in this endeavor.

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

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

r/Unity3D

our puzzle platformer about magnets we made for a game jam is OUT!!!
https://redd.it/1tn0t6d
@r_Unity3D

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

r/Unity3D

I added blackjack to Unity...
https://redd.it/1tmmdwi
@r_Unity3D

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

r/Unity3D

Developing the Movement System for My Werewolf Game. I'd like to hear your thoughts!

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

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

r/Unity3D

Unity Particle System + Collision + Sub Emitters = Nice rain ☔
https://redd.it/1tmtn2h
@r_Unity3D

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

r/Unity3D

What's new and usable in Unity Graph Toolkit 6.5 (with code)

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

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

r/Unity3D

Canvas animation with ease curves
https://redd.it/1tmkrp0
@r_Unity3D

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

r/Unity3D

Make sure you keep your distance from those prickle bombs! They are one of The Core's weaknesses.

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

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

r/Unity3D

Solo dev here struggling with AAA comparisons and expectation management for my medieval sim. How do you deal with this?

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

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

r/Unity3D

I spent weeks making a fully modular 2D pixel art weapon system (64 x 32) with mechanical animations. Just released it on Itch! What do you guys think?

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

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

r/Unity3D

Why mesh illuminated by a light source only when I look at it from a certain direction?

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

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

r/Unity3D

I didn’t expect making a platformer bullet heaven to be this fun

I’ve been working on a game called **Terraclysm**, and honestly, I didn’t expect making a **platformer bullet heaven** to be this fun.

Something about mixing platforming movement with the chaos of surviving thousands of enemies just feels surprisingly satisfying.

Right now I’m experimenting with:

* movement-based builds
* ridiculous weapon synergies
* platforming while everything tries to kill you

It’s still early, but I’m having way too much fun building this.

What’s a mechanic in a game you worked on that became way more fun than you expected?

https://preview.redd.it/07gpcbanb03h1.jpg?width=1587&format=pjpg&auto=webp&s=7647eaba39d59a546f8716ec656d608323c99bf3

steam page: [https://store.steampowered.com/app/4360290/Terraclysm\_Survivors/](https://store.steampowered.com/app/4360290/Terraclysm_Survivors/)

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

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

r/Unity3D

I just learned how to do decent-looking, scalable, UI borders after 6 months of dev on my current project lol
https://redd.it/1tlypo8
@r_Unity3D

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

r/Unity3D

ColorProfile
    {
        Unsaturated,
        HighlySaturated,
        Dark,
        Navy
    }

    void Start()
    {
        SpawnNPCS();
    }

    void SpawnNPCS()
    {
        for (int i = 0; i < spawnAmount / 2; i++)
        {
            SpawnNPC(malePrefab);
        }


        for (int i = 0; i < spawnAmount / 2; i++)
        {
            SpawnNPC(femalePrefab);
        }
    }

    void OnDrawGizmosSelected()
    {
        Gizmos.DrawWireSphere(transform.position, spawnRadius);
        Gizmos.color = Color.blue;
    }

    void SpawnNPC(GameObject npcToSpawn)
    {
        GameObject npcPrefabDupe = RandomSpawnPoint(npcToSpawn);

        SkinnedMeshRenderer npcSkinnedMesh = npcPrefabDupe.GetComponentInChildren<SkinnedMeshRenderer>();

        SetRandomBodyType(npcSkinnedMesh, bodyTypeRange);

        RandomColorWithArray(npcSkinnedMesh, raceColors, RaceColorPropID);
        RandomColorWithProfile(npcSkinnedMesh, npcClothingColorProfile, ShirtColorPropID);
        RandomColorWithProfile(npcSkinnedMesh, npcClothingColorProfile, PantsColorPropID);
        RandomColorWithProfile(npcSkinnedMesh, npcClothingColorProfile, ShoesColorPropID);

        SetRandomCutoff(npcSkinnedMesh, shirtCutoffRange, ShirtCutoffPropID);
        SetRandomCutoff(npcSkinnedMesh, pantsCutoffRange, PantsCutoffPropID);

        SetRandomSize(npcPrefabDupe, sizeRange);
    }

    GameObject RandomSpawnPoint(GameObject prefab)
    {
        Vector2 randomPoint = Random.insideUnitCircle * spawnRadius;
        Vector3 spawnPos = transform.position + new Vector3(randomPoint.x, 0, randomPoint.y);

        GameObject prefabDupe = Instantiate(prefab, spawnPos, Quaternion.identity);

        return prefabDupe;
    }

    void SetRandomBodyType(SkinnedMeshRenderer skinnedMesh, Vector2 range)
    {
        skinnedMesh.SetBlendShapeWeight(0, Random.Range(range.x, range.y));
    }

    void SetRandomSize(GameObject prefabDupe, Vector2 range)
    {
        Vector3 targetScale = new Vector3(1f, Random.Range(range.x, range.y), 1f);

        prefabDupe.transform.localScale = targetScale;
    }
   
    void SetRandomCutoff(SkinnedMeshRenderer skinnedMesh, Vector2 range, int cutoffID)
    {
        float targetCutoff = Random.Range(range.x, range.y);

        skinnedMesh.material.SetFloat(cutoffID, targetCutoff);
    }

    void RandomColorWithArray(SkinnedMeshRenderer skinnedMesh, Color[] colors, int propID)
    {
        int randomIndex = Random.Range(0, colors.Length);
        Color chosenColor = colors[randomIndex];

        skinnedMesh.material.SetColor(propID, chosenColor);
    }

    void RandomColorWithProfile(SkinnedMeshRenderer skinnedMesh, ColorProfile colorProfile, int propID)
    {
        float minH = 0f, maxH = 1f;
        float minS = 0f, maxS = 1f;
        float minV = 0f, maxV = 1f;

        switch (colorProfile)
        {
            case ColorProfile.Unsaturated:
                minS = 0.1f; maxS = 0.35f;
                minV = 0.75f; maxV = 0.95f;
                break;

            case ColorProfile.HighlySaturated:
                minS = 0.85f; maxS = 1.0f;
                minV = 0.80f; maxV = 1.0f;
                break;

            case ColorProfile.Dark:
                minS = 0.3f; maxS = 0.9f;
                minV = 0.15f; maxV = 0.35f;
                break;

            case ColorProfile.Navy:
                // Restrict hue mapping strictly to the blue spectrum
                minH = 0.58f; maxH = 0.66f;
                minS = 0.65f; maxS = 0.95f;
                minV = 0.15f; maxV = 0.45f;
                break;
        }

        float randomH =

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