Unity Code Snips
81 subscribers
28 photos
16 videos
22 files
3 links
Download Telegram
This media is not supported in your browser
VIEW IN TELEGRAM
Here's a funny and potentially useful code snippet for Unity 3D that creates a "Disco Light" effect for your game objects.

Attach this script to a Unity Light component, and it will change the light's color to a random one every half a second. It creates a disco-like effect, which can be amusing and entertaining in certain game scenarios.

Remember to adjust the changeInterval variable to control how quickly the light changes color. You can also add more parameters to customize the effect further, like changing the light intensity or range in addition to the color.
This media is not supported in your browser
VIEW IN TELEGRAM
The funny script that allows the manipulation of gravity in a game by toggling its direction when the "Jump" button is pressed.
This media is not supported in your browser
VIEW IN TELEGRAM
A Unity component that creates a plane mesh with a specified number of corners (vertices), allowing you to create polygons with different numbers of sides, such as triangles, squares, pentagons, and so on.

How to use:

1. Create a new empty GameObject in your Unity scene.
2. Attach this script to the GameObject.
3. Adjust the numVertices variable in the Inspector to set the number of corners (e.g., 3 for a triangle, 4 for a square).
4. Set the radius to control the size of the polygon.
5. Play the scene, and you'll see a polygon with the specified number of vertices.

This code allows you to dynamically create polygons with different numbers of sides by adjusting the numVertices variable. It's useful for creating a variety of shapes and can be applied in procedural generation, level design, or art installations within Unity.
This media is not supported in your browser
VIEW IN TELEGRAM
GhostMovement for Spooky Animation Using Perlin Noise. Perfect for Halloween. (Code snippet included)

Create ghostly movements in Unity with the GhostMovement component. Customize speed and curves for a spooky, floating effect using Perlin noise. Perfect for Halloween-themed games.