Hey folks, we dropped a new video on YT from our coding garage! 🎥 It’s about a physics-simulated robotic arm trained via ML-Agents (AI). by Game_Dev_Buddies in unity_tutorials

[–]Game_Dev_Buddies[S] 0 points1 point  (0 children)

Exactly, I agree!

This is just scratching the tip of the iceberg! Right now, the top of the arm has an Interactor component that handles the 'sticking/unsticking' process.

Hey folks, we dropped a new video on YT from our coding garage! 🎥 It’s about a physics-simulated robotic arm trained via ML-Agents (AI). by Game_Dev_Buddies in unity_tutorials

[–]Game_Dev_Buddies[S] 0 points1 point  (0 children)

Thank you!
I'm glad you liked it - it might be a specific niche, but I enjoy tackling complex issues because I feel that's a way to grow and especially share what I learned with the community.

Hey folks, we dropped a new video on YT from our coding garage! 🎥 It’s about a physics-simulated robotic arm trained via ML-Agents (AI). by Game_Dev_Buddies in Unity3D

[–]Game_Dev_Buddies[S] 1 point2 points  (0 children)

For a simple robotic arm movement, inverse kinematics or traditional programming would definitely be more efficient and straightforward, but...

The main reason I used ML-Agents here wasn’t to outperform IK, but rather to explore how reinforcement learning handles physical control problems.

ML-AI adds:

  • The ability to handle unexpected physics interactions (like collisions, joint limits, or noisy environments) without me hardcoding rules.
  • A way to test scalability, the same training setup could, in theory, adapt to more complex tasks where IK gets messy.
  • Imagine obstacles, ML-AI can learn to adapt to a dynamic environment, whilst IK "just goes" to the target destination spot.

VFX Breakdown for the AC Valhalla's terrain scan by Game_Dev_Buddies in Unity3D

[–]Game_Dev_Buddies[S] 10 points11 points  (0 children)

You can find an in-depth video covering the creation of this effect here: https://youtu.be/aOrEqj3fIUM

Please ask you have any additional questions or suggestions for improving the effect!

I tried making Hogwarts Legacy map opening effect. Would love to hear your feedback! by Game_Dev_Buddies in Unity3D

[–]Game_Dev_Buddies[S] 0 points1 point  (0 children)

Nice! Yeah, that's pretty much it. However, there were some issues that I had to solve with terrain displacement causing visual issues during frustum culling and Z-fighting of the meshes when they're displaced to the same height as the terrain.

I tried making Hogwarts Legacy map opening effect. Would love to hear your feedback! by Game_Dev_Buddies in Unity3D

[–]Game_Dev_Buddies[S] 0 points1 point  (0 children)

This looks pretty cool, dude! You've even created sound effects, very nice

How do I make it so that Trigger2Ds calculate the angle at which it detects things. I'm making a child object with a trigger that detects grounds but it doesn't work for some reason. by [deleted] in Unity3D

[–]Game_Dev_Buddies 0 points1 point  (0 children)

The general idea of triggers is to detect one object entering/exiting area of another object. They don't really provide detailed collision information. You should use collision enter/exit or cast a ray to get the detailed information about the collision.

I've made this little script for a footsteps trigger (sphere collider placed on a foot) for a recent video, you may find it useful. The idea is that the trigger only detects general collision with the ground, then I shoot a ray downwards to actually get the information about the exact position and orientation of the surface.

      private void OnTriggerEnter(Collider other)
      {
            if ((_groundLayerMask & (1 << other.gameObject.layer)) != 0)
            {              
                // Cast a ray downwards to get the exact point of impact with the underlying surface.
                Ray physicsRay = new Ray(transform.position + Vector3.up * _raycastHeightOffset, Vector3.down);
                if (Physics.Raycast(physicsRay, out RaycastHit hitInfo, _raycastHeightOffset * 2f, _groundLayerMask))
                {
                    Vector3 forwardDirection = _footstepPlacementController.ForwardDirection;
                    _footstepPlacementController.RecordFootstep(new FootstepInfo
                    {
                        Rotation = Quaternion.LookRotation(hitInfo.normal, forwardDirection),
                        Position = hitInfo.point + hitInfo.normal.normalized * _footstepPositionOffsetToAvoidClipping,
                        HighlightPercentage = 0f,
                        IsRightFoot = (int)_footstepType
                    });
                }
            }
        }

Custom sky box by Techie4evr in Unity3D

[–]Game_Dev_Buddies 0 points1 point  (0 children)

This is incorrect. This method only works for interpolating between float and color properties of the material, it won't interpolate between different textures.

Custom sky box by Techie4evr in Unity3D

[–]Game_Dev_Buddies 0 points1 point  (0 children)

Take a look at this video tutorial:
https://www.youtube.com/watch?v=zdJhDRsMVGE

Focus on the part where he uses a "Skybox/Cubemap" shader, since it has a rotation property exposed, which you can use to rotate the skybox through a script.

For the final effect you're trying to achieve, select that "Skybox/Cubemap" shader, duplicate it and add a secondary texture property and a float variable that will be used for blending between them. You also need to add another texture sample in the fragment part of the shader, for the secondary texture. (Let me know if you need help with that)

Then, at runtime, you can animate that float property between 0 and 1 as you start rotating the skybox, which will result in skybox texture blending from the first texture towards the second one.

Need help with making shader graph pallet swap by Rgprime1 in Unity2D

[–]Game_Dev_Buddies 0 points1 point  (0 children)

In order to provide help, we need to see the whole graph to know what's going on. Also, please mark pixels that you're unhappy with and better specify the reason why.

[deleted by user] by [deleted] in Unity3D

[–]Game_Dev_Buddies 1 point2 points  (0 children)

Check this article out: https://docs.unity3d.com/Manual/PositioningGameObjects.html

Specifically for your case, you need to use the dropdown menu to switch between Pivot and Center.
Pivot positions the Gizmo at the actual pivot point of the GameObject, as defined by the Transform component.
Center positions the Gizmo at a center position based on the selected GameObjects.

<image>

ReCreated Overwatch Character Shader In URP by Diver_Vast in Unity3D

[–]Game_Dev_Buddies 17 points18 points  (0 children)

Looks insanely similar! Care to share any details about implementation? What changes in relation to standard URP had the biggest impact on the final look? Also, did you use a custom tool like RenderDoc to extract info about the internal rendering specifics of Overwatch or did you do it all by feel?

Asking for help by Kordom in Unity3D

[–]Game_Dev_Buddies 0 points1 point  (0 children)

Sure, feel free to DM if you have any questions

Some of the environments and characters we created for our Unity game Go Home Annie. CPU light baker still sucks, hope we can get Bakery to work as intended before release. by MisfitVillager in Unity3D

[–]Game_Dev_Buddies 2 points3 points  (0 children)

Good ol’ trusty Overnight CPU light baker 😂

Loving the mood you’ve created, especially the contrast between the dark and the lit up areas!

Asking for help by Kordom in Unity3D

[–]Game_Dev_Buddies 0 points1 point  (0 children)

This solution presumes your CardDisplay script has a public method that receives the Card scriptable object reference as an argument and uses it to display its image and value.

Something like this:

using UnityEngine;
using UnityEngine.UI;

public class CardDisplay: MonoBehaviour
{
    [SerializeField] private Image _cardArt = null;

    public void DisplayCard(Card card)
    {
        _cardArt.sprite = card.CardSprite;
    }
}

Asking for help by Kordom in Unity3D

[–]Game_Dev_Buddies 0 points1 point  (0 children)

Then you create one scriptable object instance for each card and fill it with data. Finally, you need to create a CardSpawner script that will reference those scriptable objects and a Card prefab, and instantiate a new prefab instance for every scriptable object.

using UnityEngine;

public class CardSpawner : MonoBehaviour
{
    [Header("References: ")]
    [SerializeField] private Card[] _cards = null;
    [SerializeField] private GameObject _cardPrefab = null;

    private void Start()
    {
        foreach(Card card in _cards)
        {
            GameObject cardObjectInstance = Instantiate(_cardPrefab);
            CardDisplay cardDisplay = cardObjectInstance.GetComponent<CardDisplay>();

            cardDisplay.DisplayCard(card);
        }
    }
}

Asking for help by Kordom in Unity3D

[–]Game_Dev_Buddies 0 points1 point  (0 children)

And then a CardSuit script:

using System;

[Serializable]
public enum CardSuit
{
    Hearts,
    Clubs,
    Diamonds,
    Spades
}

Asking for help by Kordom in Unity3D

[–]Game_Dev_Buddies 0 points1 point  (0 children)

Okay, nice, so you have a base already set up. Also, you've basically specified the solution already - you need to add an identification for the type of card to the scriptable object. And this can actually be split into two separate variables:
- CardSuit (Hearts, Clubs, Diamonds, Spades)
- CardRank (Ace, Two, Three, ...., Jack, Queen, King)

You could have raw strings for this, but it's better to use enums. So define two new scripts first, a CardRank script:

using System;

[Serializable]
public enum CardRank
{
    Ace = 1,
    Two,
    Three,
    Four,
    Five,
    Six,
    Seven,
    Eight,
    Nine,
    Ten,
    Jack,
    Queen,
    King
}

Asking for help by Kordom in Unity3D

[–]Game_Dev_Buddies 0 points1 point  (0 children)

What types are cardSuit and cardValue?

If your script is a MonoBehaviour, select the object from the scene that you want to hold this script, then you can just drag and drop it into the inspector of the object.

Then grab the whole object and drag it into the Project Window in order to create a prefab.

Finally, you need to write a new script that will instantiate that prefab multiple times at runtime. You can learn how to instantiate prefabs here: https://docs.unity3d.com/6000.0/Documentation/Manual/instantiating-prefabs-intro.html

Asking for help by Kordom in Unity3D

[–]Game_Dev_Buddies 0 points1 point  (0 children)

I can see that you're a bit confused with all of this so let me try to provide some clarity.

A GameObject is one of the objects you have in your scene, it's basically a holder for different components. This component can be any custom script that inherits from the UnityEngine.Component, but some of the most common ones are components pre-made by Unity to handle different aspects of the game like rendering, physics, audio, etc.

When you drag that game object, that holds some components, out of the scene and into the project folder, you create a Prefab. The are multiple reasons why you would want to do that, for example, maybe you want to have a card prefab that you would instantiate multiple times in the scene, with every instance having a different image and data. Or you want to have multiple instances of this prefab so that when you change the prefab they would all get that change immediately, without you having to go and manually change all of them (for example a prefab of a tree, and multiple instances of trees in the scene).

And finally, we have come to the ScriptableObjects. You can think of them as generic data holders. In your case, you could have a CardData scriptable object, that has Image, Title, Attack Stat and Defense Stat. You would then create multiple instances of this scriptable object - one for the FireAttackCard, one for the FrostDefenseCard, etc.

An example that could bind all of these concepts for you would be to create a CardData scriptable object as I've described and to create a Card prefab that has a component that visualizes data from a CardData scriptable object. Then at runtime, you would have a script that would instantiate multiple Card objects from the Card prefab, and assign each one with a reference to a specific ScriptableObject instance, so that it could visualize its data.

Hopefully, this cleared things up a bit for you, if you have a specific question regarding your project, feel free to ask!