Chopping trees, spawning resoureces

Today I tested how to simulate chopping a tree down, and spawn resources with a random rotation, random count.
Also noticed with the default behavior, the Player was hitting the spawned cut down tree and resoureces.
I learned how to create a dedicated layer for collisions to mask specified layers.

Had a rough time with Unity’s Avatar Masks

After successfully importing a few animation along with my proto typing Blueberry looking character, I quickly realized that I had to read up on Avatar Masks.

When the character is walking and attack animation is triggered, the walk freezes. Basically making the character look like it’s sliding for a brief moment.
After looking up forum posts and youtube videos, most of the information were on Avatar Masks using Humanoid Avatar type.
My Blueberry is using a Generic avatar. This meant that I have to manually select which bones to mask from the Transform menu within the Avatar Mask’s inspector/property.
My bones are generated using Blender’s Rigify and I haven’t looked deep into the bone relations. This gave me a hefty 6 hour troubleshooting session thinking I had something wrong elsewhere…

TLDR; I missed a few bones that were related to the upperbody animation which I had to have selected.

Tris: 5,500 = barely Low poly? Mid?

I truly hate working on characters in Blender. I know you just need practice, but I rather work on props. The learning curve and art direction seems to be easier 2D/Pixel for beginners. I’m sure Mastering the skill is a whole different story.

After reading through some posts by other artists, I came to a conclusion that 5,500 triangles is probably nearing the ceiling of being abel to call this model a low poly.

Simulating Day Night Cycle

This is a first attempt and test using the directional light

using UnityEngine;

public class DayNightCycle : MonoBehaviour
{
    [Header("Time Settings")] [Range(0, 24)]
    public float timeOfDay = 12.0f;
    
    // seconds in real time for a full day cycle
    public float dayDuration = 240.0f; 

    [Header("Sun Settings")] public Light sun;

    public Gradient sunColor;
    public AnimationCurve sunIntensity;

    [Header("Sky Settings")] public Material skyboxMaterial;

    public float maxAmbientIntensity = 1.0f;
    public Gradient ambientColor;

    void Update()
    {
        // Update time of day
        timeOfDay += Time.deltaTime / dayDuration * 24.0f;
        if (timeOfDay >= 24.0f) {
            timeOfDay -= 24.0f;
        }

        // Calculate sun rotation
        // 15 degrees per hour, offset to start at dawn
        var sunRotation = timeOfDay * 15.0f - 90.0f;

        // Apply rotation to the sun
        sun.transform.rotation = Quaternion.Euler(sunRotation, -30.0f, 0);

        // Update light color and intensity based on time of day
        var dayNightRatio = Mathf.InverseLerp(0, 24, timeOfDay);
        if (timeOfDay > 12) {
            dayNightRatio = Mathf.InverseLerp(24, 12, timeOfDay);
        }

        sun.color = sunColor.Evaluate(dayNightRatio);
        sun.intensity = sunIntensity.Evaluate(dayNightRatio);

        // Update ambient lighting
        RenderSettings.ambientLight = ambientColor.Evaluate(dayNightRatio);

        // Update skybox (if using a skybox that supports time of day)
        if (skyboxMaterial != null && skyboxMaterial.HasProperty("_Exposure")) {
            skyboxMaterial.SetFloat("_Exposure", sunIntensity.Evaluate(dayNightRatio));
        }
    }
}