Floor is slippery when wet...

... and evidently when it's made of stone...

So, hooking up the player character animations and movement controls was a time consuming process. And it works...for the most part. This was my first pass at implementing movement/playable character into unity - granted having a fully animated player character to import helps a tonne, but splitting out the animations and linking them up when the character runs/walks was a new experience for me. I create a small dummy hallway of sorts to get a sense of scale, movement, enemies and all that jazz.



Here's a gif to show it semi working:




Now, the thing to take from this is, my initial pass I was still unsure of what kind of camera/control scheme I was going to utilize in this level/game/prototype/vertical slice/buzzword 5/thing. The method above shows the characters direction being oriented around the mouse location, the beginnings of a point and click...sort of..or more accurately, WASD and the mouse will aim the character - I didn't like it...

I'll talk more on that later.

In the GIF above, there's enemies...Naturally...there's always enemies in dungeons... Anyway, these were easy to setup up, at least for the most part. Initially I don't have to have these be controlled by the player, a simple "run at player character" would suffice for now, and I can tidy up the logic later with variables, such as Line of Sight and such. To set these guys up, a simple capsule collider and move script will do the job:


    [SerializeField]
    Transform player;
    private NavMeshAgent nav;
    private Animator anim;
    void Awake()
    {
        Assert.IsNotNull(player);
    }
// Use this for initialization
void Start () {
        anim = GetComponent();
        nav = GetComponent();
}
// Update is called once per frame
void Update () {
        nav.SetDestination(player.position);
}
}
Now, these have been set up with basic balance ideas in mind, so I can balance them later, easy acess to things such as move speed, attack range, attack damage are in the "attack" script (not shown) for adjustments later. Now, the script is really rudimentary, I'm not an expert programmer (just learning what I can for now)


Here's a gif of the them in motion!





A few initial bugs I noticed are the sliding of the run cycles from the player and the enemies (I'll fix this later, it's not hugely important right now), the "leaping" motion from the enemies, they can "displace" quite a distance, likely linked to the attack range, But something I can tinker with easily, at a later date anyway. Lastly, the collision, this was an easy fix/small oversight, I didn't expect to the enemies to force their full collision into the player, forcing them to move on the Y axis, a simple freeze position on this axis stopped this.

Comments

Popular posts from this blog

Regions, Events, Sound Design, Collectibles & Assets...

Small dev update and ramblings. Ideals finalized, gameplay imminent!

Embed The Narrative! And the mechanics?