Conveyor belt in Unity controlled by Arduino

By GameDevTraum

Introduction In this article we will see a downloadable solution that consists of a conveyor belt made in Unity, whose operation is controlled using an Arduino plate. Thank you “Akyra Brasil” for proposing this exercise in the comments Downloads In the next package you will find two folders, one with the Unity files and one…

Wiring System for Unity

By GameDevTraum

Introduction In this article I present a solution to automatically create cables that hang from two or more points. The system allows us to modify the thickness of the cable, the curvature and more parameters to achieve the result we want. The wire is drawn using Unity’s Line Renderer component so it is generated procedurally…

Distance between two Objects in Unity

By GameDevTraum

Introduction In this article we will see different ways to calculate the distance between two objects in Unity, this can be useful for example to know how far is the character from a certain point of the scenario or to activate mechanisms when the character is at a certain distance. Setting up the scene Let’s…

What is a RigidBody in Unity?

By GameDevTraum

Introduction In this article we are going to see the RigidBody component in Unity, what it is for and how to use it. Knowing about this component will allow you to create precise physics in your game. What is a RigidBody in Unity? First RigidBody in Unity is a “Programming Class” defined at the core…

FixedUpdate Method in Unity

By GameDevTraum

Introduction In this article we are going to analyze Unity’s FixedUpdate method which allows us to make changes over time in our projects. A method is a function defined in a script that can be executed and performs the task we define inside it. To learn more about methods in programming you can read this article or watch…

Update Method – Unity

By GameDevTraum

Introduction In this article we are going to analyze Unity’s Update method which allows us to make changes over time in our projects. A method is a function defined in a script that can be executed and performs the task we define inside it. To learn more about methods in programming you can read this…

What is a GameObject? – Unity

By GameDevTraum

Introduction GameObjects are entities that we can place in Unity scenes, each GameObject will occupy a place in the hierarchy. In the field of programming, GameObject is a Programming Class. Basic features of a GameObject Let’s see what are the basic features and components of an Empty GameObject which is the most general that we…

Fade In/Out the Screen in Unity

By GameDevTraum

Introduction In this article we’re going to see a simple way to darken the screen in Unity using an image component. This can be very useful for example to use as a transition in a scene change. The following video shows the result that we will obtain at the end. Explanatory video and downloads The…

Prototype of Artificial Intelligence for enemies – Unity

By GameDevTraum

Introduction In this article we see a prototype of artificial intelligence for enemies in Unity. These enemies will be in different states according to what happens during the game. The states are “Guard”, “Searching”, “Attacking”, “Covering”. The idea for this prototype came about because a person wrote to me in the channel’s comments asking how…

#10 Change Scenes at runtime in Unity. LoadScene Method

By GameDevTraum

Introduction This is the last exercise in Unity’s Fundamental Series, in this article we’re going to see how to change the scene in Unity at runtime. Understanding how to change the scene is important because it allows us to separate the content of our game into parts, for example the main menu on one side…

#9 Rotate objects in Unity. Rotate method of the Transform class.

By GameDevTraum

Introduction In this article we’re going to see how to rotate objects in Unity. There are several ways to achieve this, in this case we will use the Rotate method of the Transform class, this will directly modify the rotation parameters that are observed at the top of the inspector with the GameObject selected. Go…

#8 Invoke Methods in Unity

By GameDevTraum

Introduction In this article we are going to see how to use the Invoke method of Unity’s MonoBehaviour class to execute an action with a certain delay. This allows us for example to create mechanisms that work for a while. Go to the project’s main page Before we start I invite you to watch the…

#7 AddForce Method in Unity. RigidBody Class

By GameDevTraum

Introduction In this article we are going to study how to use the AddForce method of Unity’s RigidBody class, which allows us to apply forces to GameObjects that have a RigidBody component assigned to them. The goal is to make the ball in the GameDevLab bounce indefinitely for the duration of the game. Go to…

#5 OnTriggerStay Method. Detecting Objects inside a region.

By GameDevTraum

Introduction In this article we are going to study how to use the OnTriggerStay method to detect the character in a certain region and apply actions when that happens. Specifically, we’re going to make the damage and health regeneration stations affect the character. Go to the project’s main page Before I start I invite you…

#4 Create and Destroy GameObjects in Unity at Runtime

By GameDevTraum

Introduction In this article we’re going to look at how to create and destroy GameObjects at runtime. Achieving this is very important for creating games, because it allows us to place objects when and where we want and then destroy them. Go to the project’s main page Before we begin, I invite you to watch…

#3 LookAt Method

By GameDevTraum

Introduction In this article we’re going to analyze how to apply the LookAt method in Unity, to make one GameObject look in the direction of another. Go to the project’s main page Before we begin, I invite you to watch the following video that resolves this problem, make sure to activate english subtitles. Procedure We…

#2 Find GameObjects from the Hierarchy in a Script

By GameDevTraum

Introduction In this article we are going to study different ways to find, from a Script, the GameObjects that are in the hierarchy in Unity. Among the forms we have to assign directly the objects from the inspector or find them through methods like “FindGameObject”. Go to the project’s main page Before we begin, I…