#2- Learning to Walk
First Steps - Part II
In the previous post, you saw the small map and the main characters that would inhabit it. Our current goal is to achieve basic interaction with the dog, starting with its movement.
My idea is that the dog can follow you and that you can interact with it in some way, allowing you to control not only the player but also the dog. My plan is to use the keyboard to control the main player and the mouse for the dog.
My first approach for the dog's movement was to use the NavMesh Agent component. This package includes some scripts, so I used to moving the dog with the mouse.
Spoiler: Bad idea.
Let's see what the problem is.
Initially, my idea for mouse movement was to give the dog specific commands, but it was clear that it was not a good idea for the dog's general movement, as it feels very awkward. However, it is still interesting to be able to execute some actions by clicking on specific objects for the dog to interact with, but right now, we're focused on movement.
My next strategy was to define a zone around the player. I suspected the dog might move around constantly, and my idea was that if the dog is close to the player, it should stay put. To do this, I thought of adding a Box Collider so the dog would always have to move towards the inside of the collider.
The goal is "achieved," but not in the way I wanted.
This is because the transition between the "walk" to"idle" animations isn't coordinated with the dog's movement, which gives it that "skating" feeling.
I suspected it might be a value in the Animator, but I finally realized that wasn't the problem. It was a matter of the code logic. For the curious, I'll leave a link to my repository.
https://github.com/RuuRoger/TOGETHER/blob/main/Assets/Scripts/Dog/DogController....
Our next goal is to add new mechanics to interact with the dog.
Feel free to leave suggestions, and thanks for reading.
Ruu. :)
TOGETHER
You are never alone. Remember this treasure.
Status | Prototype |
Author | RuuRoger |
Genre | Adventure |
Tags | First-Person, Singleplayer |
More posts
- #5 - Breaking down to build up2 days ago
- #4 - Bad Camera, Bad Game26 days ago
- #3 - "Dress me slowly, I'm in a hurry"49 days ago
- #1- First Steps75 days ago
- #0 - TOGHETER: The Devlog81 days ago
Leave a comment
Log in with itch.io to leave a comment.