omarvision
Full Stack Developer (>20 yrs) Microsoft C#, VB, C++ SQL Server, Oracle Game Development Unity, DirectX, OpenGL, Blender Hobby Kids Coding Instructor
Omarvision Kids CodingTampa, Florida
Pinned Repositories
3WaysToMoveCar
3 ways to move cars in unity
animate-3d-models-with-mixamo
How to Animate a MagicaVoxel 3D Model using Mixamo. Import the model and animation data into Unity and play the character with joystick or keyboard input.
create-bones-on-transparent-2D-image
Animate 2D images in Unity with the 2d Animation package. Here I'll use Unity 2021.1 and the sprite editor to create bones on a picture of the pink panther. The sprite editor will also add geometry (mesh outline of the 2D image) and weight (effect of each bone on the nearby geometry). The geometry and the weight have automatic features. After the bones are added to the sprite asset, drag and drop the sprite into the scene. Add a 2D Animation, Sprite Skin component and click the button create bones, so the component can detect all the bones you added in the sprite editor. Then when you move the bones the sprite beneath it moves. You can now animate it.
how-todo-marching-cubes
Haven't made a video in a while. That's because this marching cubes algorithm took me awhile to unravel. Most of the work was in the 256 cube configurations and the isofaces it takes to build them. I figured them all out myself (even though there were probably daat available on internet somewhere). Oh well, learn the hard way, and I'll never forget. In this video I'll go over how the marching cube algorithm works, how to use it, how to figure out the cube configurations. You'll see it animated in action. There is a cube configurator scene that helps you see what each cube configuration looks like. the MarchingCube.cs file is reusable so you don't have to write it everytime you start a new game project.
inspector-dropdown-editorGUIlayout.popup-
How do you add a dropdown to the Unity Inspector window for your script? You could use enum public variable type. But you can also use an array like I do in this tutorial here. I use a string array and a List collection. These are helpful if you don;t know what the contents of your array will be.
load-external-mp3-with-script-from-anywhere
Imagine making an audio player in Unity. How do you load a file from anywhere on the harddrive in Unity? I found a way to load a WAV file from anywhere on the HardDrive using WWW, but then I couldn't load an Mp3 file. I didn't give up I found that I could use NAudio.dll library to convert an MP3 to WAV in memory and then use the WWW to load the MP3 file from an external location in Unity. Hopefully WWW (which is deprecated) sticks around a while longer... or is replaced with something better.
marching-cubes-with-linear-interpolation
procedural-punch-to-target
HOw would you like to know how to animate a character to always punch toward any target in a scene? How to pick up any object they can reach? You dont want to use a canned animation because the scene placement maybe off a little. A solution is to mix the canned animation with a procedural one. Mic the canned animation with an Implementation of real-time inverse kinematics in Unity using the animation rigging package. YouTube
SelfDrivingCars
Use Neural Networks (MLAgents) to train cars to drive on track using barriers and no barriers
Softbody-Physics-Spring-Joint-
Turn a mesh mushy with softbody physics. How can I make softbody physics in Unity using the things unity has built in? I tried to make softbody using a rigged mesh and spring joints. Here is how it came out. YouTube
omarvision's Repositories
omarvision/load-external-mp3-with-script-from-anywhere
Imagine making an audio player in Unity. How do you load a file from anywhere on the harddrive in Unity? I found a way to load a WAV file from anywhere on the HardDrive using WWW, but then I couldn't load an Mp3 file. I didn't give up I found that I could use NAudio.dll library to convert an MP3 to WAV in memory and then use the WWW to load the MP3 file from an external location in Unity. Hopefully WWW (which is deprecated) sticks around a while longer... or is replaced with something better.
omarvision/procedural-mesh-01-mesh-through-code
There is more than one way to make a mesh. You can use a Unity primitive. You can make a mesh outside of unity with tools like Blender or Magicavoxel. Or... you can procedurally generate a mesh through code in Unity using scripts. When you procedurally generate a mesh there are some benefits. You can do things like the voxel worlds of Minecraft and more. In this Unity tutorial we will make the simplest mesh (a triangle) all the way up to a cube mesh using C# scripts. We will see how to specify the vertices, triangles, and uv coordinates for materials (textures). And we will understand how to specify to Unity which side of the mesh polygons to render and which to not (backface culling)
omarvision/slippery-bouncy-physics-material-tutorial
When gameobjects collide what decides the rules of how they interact with each other? Are they slippery like ice, bouncy like a ball, or is it like dragging a block of cement? In Unity, the colliders can have a material assigned to them - physics materials. The physic materials of these colliders with materials will be visible when they are sliding on a surface of when the physics forces of a rigidbody push gameobjects into eachother. In this unity tutorial we will see how to setup some physics materials and control a game object with the keyboard, and we will see some game objects just falling and sliding on surfaces.
omarvision/animated-jumping-problem
I had a problem using jump animations from Mixamo.com where I couldn't sync up the jump and the landing on objects. So, I figured a way to get around that by duplicating the jump animation. Playing the first half of the getting ready for the jump. Playing the second half for the landing of the jump. I only applied the up force to the rigidbody at the proper frame of the animation up jump by using an animation event to call my script ApplyUpForce() method.
omarvision/everything-about-a-voxel
I want to make a minecraft like terrain for a game. If I were to make thousands of unity cubes, my computer comes to a crawl. How do you do it? We are going to have to learn about a thing called a voxel. We make cube mesh in a C# script. We will make a smooth voxel where the vertices are shared. We will make a flat voxel where each of the 6-sides has the same normal. And then we will learn how to make and use a material on our voxel that has a different picture (or texture) on the sides.
omarvision/game-camp-coding-enemy-chase-shoot
day 1 and 2 of game camp we learned the Unity interface and placed objects in a scene. Then we finally made a player object in the scene that we moved and controlled using the W,A,S,D keys (or arrow keys) to move around the scene as we played the game. this video cover day 3 and 4 of the game camp of June 2019. We introduced some AI gameobjects that can move around the scene on their own randomly. And we improved the control of our player in the scene. The enemies are spawned into the game using an enemies script. Our player is now able to look out from a first person point of view. We made a child camera object to see out of our players eyes. We look around with the mouse and move with W,A,S,D AND we can shoot shots. The shots use an idea called pooling. which we learn about too.
omarvision/new-terrain-system
there is a better version of this video (no choppiness) here: https://youtu.be/pCh0EvvBIoM So the new Unity 2018.3 has some changes. The terrain tools is a little different. You may have to find the editor controls new arrangements. Watch this video to help learn the new terrain tool. Baking... [ETA:...] -- you can temporarily stop it by making by un-checking "static" for the Terrain in the inspector window!!!! you may also want to check this video to see how to stop the Baking ETA thing via project settings: https://youtu.be/RMAXNXFwmXM?list=PLmBprbjofP9hjJgfJkxL0cPlenY11Ujf7 * This tutorial video first goes over me using the "Unity Hub" - looks like its great for choosing the version of unity to open projects up in & for keeping up to date with the latest versions of unity * Then the video goes into painting texture on the terrain. You can paint multiple layers of different textures. * You can raise and lower the terrain. To lower the terrain use [shift] and mouse click * you can add connected terrains to your existing terrain. That's new! * you can stamp the terrain with a brush shape * you can use your own images for terrain brushes. There's a new button "new brush" * Then the video shows how to add "Speed Trees" to the terrain. Speed trees look very good and you can download some for free from the asset store * You can paint the texture of grass on the terrain but even better you can add grass blades, that blow in the wind to the terrain using an image of grass blades you find on the internet. * You can add rocks on other little mesh details by painting them on the terrain too using "Paint Details"
omarvision/new-terrain-system-2018.3
In the newer version of Unity (Unity 2018.3, Unity 2019) there are some new terrain tools added. The terrain tools got reorganized a little bit so you may need a refresher tutorial video like this one to help get you started. I go over a couple of things here: 1. unity hub 2. terrain paint tool and the combo items within a. paint texture b. raise lower terrain c. smooth height d. neighbor terrain e. stamp terrain f. adding speed trees to your terrain (paint details) g. adding stones and pebbles to your terrain (paint details) 3. and the finally we add a player to the scene that we can walk around the terrain in 1st person view.
omarvision/perlin-noise-procedural-hills
Perlin Noise is an algorithm that games use to make various randomly generated things (dungeons, levels, terrain, endless, etc.) In this tutorial video, I am going to use perlin noise to generate hills. I generate hills in 2d and in 3d at the end. I was planning on using this information in combination with my learning about voxels to make a minecraft like world.
omarvision/read-multiple-gamepads
In Unity 2019.1 how can I read all the inputs from a gamepad controller (like a Xbox 360 controller or Playstation Controller)? After that how can I read the input from multiple gamepad controllers so I can make a two player game? In this Omarvision tutorial video I show you how to read from multiple gamepad controllers at once. It's easy. You can download my InputManager.asset file or make one yourself in the project settings.
omarvision/tap-bpm-detection-manual-beat-detection
If you have a waveform in Unity that is a song and want to know how many beats per minute (bpm) the song is, you can figure it out by tapping the beats while you listen to the song playback. This unity tutorial goes over how to tap the beats to a playing song and get the beats per minute (bpm) that the song is playing at. I call this manual beat detection because you (the user) has to tap the beats to get the bpm.
omarvision/UI-grid-control-scroll-view-with-button
In Unity can I make some sort of data grid control? YES! I can. In this tutorial I make a grid like UI control and populate the grid with mp3 files found on my harddrive. I also play the mp3 songs found on my harddrive in unity using the NAudio.dll from the internet and WWW class from Unity.
omarvision/voxel-terrain-finally
Ive been working on making it to this tutorial video for quite some time now. How to make a voxel terrain with hills and all. There were many obstacles to overcome, like the fact that a single mesh has a vertex limit of 64K, so that's why we make chunks of voxels. then with chunks of voxels, how do I apply the perlin noise algorithm to make the hills? How do I quickly determine which voxel in a mesh is selected by the user? how do I determine the space beside a voxel to add a voxel for the user? and how do I do thus all reasonably fast? Well, I have come to some satisfaction of answers for all those questions. I will reveal them to you here in this video!! I know there is still more to figure out, like trees and caves and random placement of deposits of coal and minerals in the terrain, but let me enjoy this milestone for now.
omarvision/waveform-2D
How do i display a waveform in a Unity 2D project? I create a Texture2D within a script that I have mapped the samples of an audio track on. I use AudioClip.GetData to get all the samples at once. And use texture2d.SetPixel to draw the waveform on the texture before assigning to a Sprite GameObject.
omarvision/a-chunk-of-voxels
When making a voxelized world, you have meshes that are groups (or chunks) of voxels at a time. Unity has a limit on the amount of vertices one mesh may contain. When making large voxel worlds you will have to organize you voxels into chunks. It is also wise to use chunks so that the voxel world is not just one big massive group of voxels but rather workable pieces. In this video see how I organized a group of voxels into one chunk. Also see how I made a first person player, and can walk on the voxels and add, remove voxels with mouse left and right clicks
omarvision/AI-car-drive-on-racetrack
Im working on a racing game in Unity. This is probably my 5th attempt to complete a racing game. In this tutorial I plan to explain how I will have the AI cars drive around the race track. In simple form, the AI cars will follow checkpoints around the track. The checkpoints I place on the track in design time. Each checkpoint has an invisible wall that fires a trigger event when the car collides with it. Then I change the checkpoint the Ai car aims at.
omarvision/boxer-collider2d-animation-events
http://localhost:50213/Scripts/Boxer2D#boxer2 - assets https://youtu.be/O1nOCyyvF4w?list=PLmBprbjofP9hs2cIpPLB0JFD-4yn_GEAO - 1st video The second of 2 videos making a 2D Boxer that can punch and kick a heavy bag. In this video we go over adding collider2d objects to the fist bone and the foot kick bone. We also use animation events to turn the puch and kick colliders on at the right parts of the animations for the attacks.
omarvision/boxer-sprite-bones-animations
http://localhost:50213/Scripts/Boxer2D#boxer1 - assets https://youtu.be/NAfD48Jt_ek?list=PLmBprbjofP9hs2cIpPLB0JFD-4yn_GEAO - 2nd video Thinking about making a fighting game in 2D? maybe this video can help get you started. I make a 2D Fighter (or Boxer) character that's animated to throw a punch and a kick at the user's command. We throw a punching bag into the scene so we can have something to hit.
omarvision/combining-meshes-redurce-batches
In Unity you always have to look for ways to optimize you game operations, like rendering meshes. If you have more individual meshes there is more time the computer has to spend on rendering. You can combine meshes sometimes to save precious time. On the MeshFilter.mesh object there is a function called CombineMeshes that combines an array of CombineInstance meshes into one mesh. This saves on the Stats Batches count.
omarvision/control-your-monkey-playable-monkey-in-3d
I just decided to have fun and make a monkey in magicavoxel. Find some animations for it in mixamo. And then, move it around in a 3D scene using rigidbody physics. Added a nice little camera follow code and then tried jumping on a box. I wonder if using physics.AddRelativeForce will be more fun than Transform.Translate for moving around?
omarvision/game-coding-camp-day-1-and-2
In this video I go over some "review notes" of what we did on the first two days of June 2019 game coding camp. Sometimes everyone is to busy to take notes. So here is a video to help out. Also, to get hte project goto http://www.omarvision.com/tutorials and you can type "june 2019" to search for the video, files, etc.
omarvision/make-just-one-voxel
I made a C# class to make just one voxel. The methods in the class allow me to make the voxel one side at a time. The methods in the voxel class also allow me to specify an different image to be rendered on each side of the voxel using a material that has various images tiled together in it.
omarvision/making-clouds-with-particle-system
Who would have thought? Make Clouds for your game using particle systems! The clouds can move and swirl and come to life and look natural without much effort. Make clouds by making very large smoky style particles in Unity. This tutorial shows you how!
omarvision/procedural-terrain-generation
Find out how to modify terrain height and texture from C# script in this tutorial video. You may want to modify the terrain height as an in game feature from a hit or explosion. And, changing the texture through script may be useful if you want to leave tracks on the terrain or some other effect. I plan to use the changing texture knowledge to leave skid marks on a race track.
omarvision/staying-within-bounds
So you are making a 3D game and you are wondering how do I keep my players and gameobjects from moving right off the screen -or- from moving off the world? You can do it a number of ways. I used my imagination and came up with two ways. 1st way I tried was placing some walls around my scene that the player would collide with and no be able to pass. I can make the walls invisible by turning off the mesh renderer. 2nd way is a little more thoughful. I use an very large 3D object to encase my scene within. Then I use the Is Trigger flag on the collider. I detect when the player exits the object and push player back in. Check out the video to see how I did both ways...
omarvision/the-simplest-mesh
In Unity 2019.1 how do you make the simplest mesh by script? You watch this video that's how. My Daughter and I go thru explaining how to make a triangle mesg (the simplest mesh) in Unity. We start from scratch and we add a texture. We explain uv mapping, backface culling, clockwise triangle points and crack a couple of jokes.
omarvision/vector-directions-use-normals-to-determine-voxel
Use the mesh face normal to calculate the coordinate of the voxel hit in a voxel grid. Vector direction... normals??? "Normals" are vectors sized down to 1 unity unit, that are perpendicular to the mesh face from which they protrude. You know what that means? that means I can use a normal to figure out what voxel position I just mouse clicked on in a voxel terrain. I can use the normal combined with the hit point to get the coordinates of a voxel I just clicked on (and multiple the normal by a negative amount to go in the opposite direction) Or I can use the normal and multiple by a positive amount to move forward into the neighboring voxel's coordinate.
omarvision/visualize-audio-graphic-equalizer
Visualize Audio Data by splitting the sample data playback into frequency ranges and changing the height of some cubes. Use AudioSource.GetSpectrumData... I think this method is being deprecated but I have this video ready now, I'll make another with the more recent function to call later.
omarvision/visualize-audio-over-time
In Unity the GetSpectrumData is turning out to be fun. It splits the audiosource sound into samples by frequency at an instant. If I take those samples at an instant I can visualize them on a series of quad gameobject heights - which kind of looks like a graphic equalizer. And I dont stop there. I also look at the graphic equalizer display of the sound samples over time and it kind of show the history of the sound. I can start to see the sound in a new way... giving me ideas!
omarvision/voxels-procedural-mesh
Click and the mesh adds another voxel. Click and I take away a voxel. A voxel is basically a cube. And like the famous game minecraft, this video goes over how to add and remove voxels from a procedural mesh by clicking on the side of a voxel. There is also a second script that allows us to control the camera movement so we can fly around the scene space and click anywhere on our voxel composed mesh to add and remove voxels. After all our voxel procedural mesh is 3D adn we have to be able to move around it. I know you want the scripts and files for this tutorial so come and get them at my website: http://omarvision.com/Tutorials/Index - and search for voxel