Subscribe to Our Insights We don't spam!
Transform: the base block of every game object in Unity. Make sure your character’s transform scale isnormalized at 1,1,1. If you need to make a bigger or smaller character, always adjust the model’s scale, not the base transform. BoxCollider2D: the collider whose size is used to det...
Unity allows us to assign scripts to each state of the animator. This lets us execute chunks of code only when the character is in a specific state. This comes very handy when we compartmentalize our code and helps to improve the traceability of our errors. CharacterMove: This is the main...
I'm trying to make a patrolling AI character that will move from point to point. The patrol part works perfectly. However, the problem is that the sprite only faces right. When it turned the sprite stays facing the same direction. I have tried to change the...
Unpack that and open the RocketMouse.unity scene contained within. Making the Mouse Fly Forward It’s time to move forward — literally! To make the mouse fly forward you will need to do two things: Make the mouse move. Make the camera follow the mouse. Adding a bit of code will solve...
Let's create a few barriers to block the line of sight from our AI character to the tank. These will be short but wide cubes grouped under an empty game object calledObstacles. Add a plane to be used as a floor. Then, we add a directional light so that we can see what is goin...
@CodeMonkeyUnity It's just a sphere @tinto9700 Is there a way to add collisions for the 3D script? My player character is currently moving through other game objects. I've tried removing the sphere collider on my player, but that's not the type of collision I want to create. ...
Likewise with touch, when an enemy gets too close, we want to be able to sense that, almost as if our AI character can hear that the enemy is nearby. Then we'll write a minimal Aspect class that our senses will be looking for. Cone of sight A raycast is a feature in Unity t...