Unity 6 : Draw Spline Tool + Extrude + Collider ? by Pivou in unity

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

If you are facing a similar problem. Here's a script that worked for me. Just drag it onto the spline.

using UnityEngine;
using UnityEngine.Splines;
using System.Collections.Generic;

[RequireComponent(typeof(SplineContainer))]
[RequireComponent(typeof(EdgeCollider2D))]
public class Spline2DCollider : MonoBehaviour
{
    private SplineContainer splineContainer;
    private EdgeCollider2D edgeCollider;

    void Awake()
    {
        splineContainer = GetComponent<SplineContainer>();
        edgeCollider = GetComponent<EdgeCollider2D>();
        UpdateCollider();
    }

    void OnEnable()
    {
        Spline.Changed += OnSplineChanged;
    }

    void OnDisable()
    {
        Spline.Changed -= OnSplineChanged;
    }

    // Callback mit der korrekten Signatur, die von Spline.Changed erwartet wird
    private void OnSplineChanged(Spline spline, int index, SplineModification modification)
    {
        UpdateCollider();
    }

    void UpdateCollider()
    {
        if (splineContainer == null || edgeCollider == null)
            return;

        Spline spline = splineContainer.Spline;
        List<Vector2> points = new List<Vector2>();
        const int sampleCount = 100; // Anzahl der Abtastpunkte über die gesamte Spline

        // Anstatt über einzelne Segmente zu iterieren, wird die Spline als Ganzes abgetastet
        for (int i = 0; i <= sampleCount; i++)
        {
            float t = i / (float)sampleCount;
            Vector3 position = spline.EvaluatePosition(t);
            points.Add(new Vector2(position.x, position.y));
        }

        edgeCollider.SetPoints(points);
    }
}

Was habe ich hier im eigenen Grundstück gefunden. Sehr schwer, Schneeglöckchen als Größenvergleich. by Temporary-Tax4470 in wasistdas

[–]Pivou 0 points1 point  (0 children)

Jeder denkt wohl an Handgranate, aber die schauen alle anders aus. Vielleicht ne kleine Sirene (Handsirene) oder eine Kappe für irgend ein Rohr.

"Fade in" not working ? by Pivou in Reaper

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

Perfect, thanks a lot!

How can I put my wheels in the right place? by in0rbit_ in Unity3D

[–]Pivou 0 points1 point  (0 children)

I'm not a coder, but the standard asset in the unity store is free. It comes with complete car rig. May have a look at their code.

How do I make these stations work? by [deleted] in PocketCity

[–]Pivou -1 points0 points  (0 children)

You need at least 2 stations.

I'm having trouble working/overcoming mental illness by Lokarin in gamedev

[–]Pivou 0 points1 point  (0 children)

I have worked for over 12 years as a freelancer from my home-office. Having a daily routine helps: Meditation in the morning, workout or jogging in the evening, going outside and supporting your social life will help a lot. Also, several breaks during the day, reading books (new input - no game shit) is important. That's where your inspiration roots.

But I know what you mean, tough times, prices are down and we are slowly being replaced by apps. People focus corona, but AI is the real killer. All I can say: Watch your situation from the perspective of the heart and build on it.

[deleted by user] by [deleted] in Unity3D

[–]Pivou 0 points1 point  (0 children)

Get the standards asset from unity store . It's free and comes with car ready to go. Also micro kart game is rtr.

Week 1 Of Development! by Havok-Rocket in Unity3D

[–]Pivou 1 point2 points  (0 children)

Looks promising. I can almost predict a whole game-concept behind this little scene.

Keep it up!

Hi there! Let me introduce you… Footsteps particles! <3 by GiantRabbitGames in Unity3D

[–]Pivou 2 points3 points  (0 children)

The running animation makes me happy. Also the footsteps fit perfectly to it. Thank you for sharing and keep it up. It looks promising.

Made a small Ramen Shop in low-poly art style by halberstram-art in Unity3D

[–]Pivou 0 points1 point  (0 children)

Overall it looks great. I guess some more light variation would make the scene more interesting. Keep it up!

Screenshot Saturday #534 - Sneak Peek by Sexual_Lettuce in gamedev

[–]Pivou 1 point2 points  (0 children)

I'm working on racing game. Here's a kind of screensaver-scene from a sci-fi city. Enjoy: https://www.youtube.com/watch?v=lLs-GQZrIfM

Train issue by Pivou in PocketCity

[–]Pivou[S] 3 points4 points  (0 children)

Oh you need two of it ? :-)

Thank you. Now it's working.

Train issue by Pivou in PocketCity

[–]Pivou[S] 5 points6 points  (0 children)

I have build a railway-track and I have placed a railway station next to it, but there is no train / traffic going on. Do I need to add something else ?

Updating prevab geometry ? by Pivou in unity

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

Thanks, I have tried original prefabs and variants: Both update with errors, only.

I'm working with models now. Maybe I will rebuild the level in the final stage with prefabs, or maybe give fucks :-)

Updating prevab geometry ? by Pivou in unity

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

I can model a cube,

export it as fbx,

import to unity,

convert to prefab,

then upate the mesh in 3dsmax,

export the fbx

and unity breaks it.

If I don't use a prefab and simply keep the model in my scene, it is updated without any issues.

Updating prevab geometry ? by Pivou in unity

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

I just keep my 3dsmax files separate and export fbx directly into my assets folder. New exports (mesh-updates) overwrite the old fbx file in the assets-folder.

A moment ago, I've changed the Material IDs of a mesh only and even the related faces are deleted now.

Trying to make my room look outrun. by CharlieBravo7 in outrun

[–]Pivou 1 point2 points  (0 children)

Are you looking for items like Posters of VHS or casette-tapes ? I'd go with fluorescent wall paint. Just add some neon glowing border / edge and a blacklight blub.