Saturday, April 18, 2020

Been busy, actually coding!

So been a quiet couple of weeks in lockdown, some (more) exciting personal news which I will be able to share soon but also working on implementing A* within the Mr. Taft Zelda-like series.

As usual, my code for this is fully shared on Github but is yet to be properly documented! That is the next task.

Anyway, for a sneaky preview of the finished article.

Features: 


  • It only starts pathfinding if the player is inside the grid, will also stop pathfinding once the player exits.
  • Unwalkable grid positions are calculated at runtime start based on the tilemap colliders (via a layermask)
  • pathfinding runs every x seconds as to not be continually calculating paths

Thank you!

Wouldn't have been possible without the excellent grid tutorials from CodeMonkey and of course Mr Taft! and his amazing Zelda-like.




Wednesday, April 8, 2020

A Unity experiment - Boss!

I wondered just how much of a Trinexx type boss I could make without much code, this is my WIP so far!

Uses: Hinge Joints x LOTS!, DoTween for movement and an FSM per head and body.

Still lot's to do but it's getting there!
Janky WIP Boss

Mr Taft FAQ 2 - Player Movement Speed is Choppy/Slow

This is the second in a series of FAQ articles to accompany the Zelda Like Tutorial Series from Mr. Taft. 


The Question:


"Hi guys my player is moving choppy like it is slowing down then going faster after a few seconds I'm not sure what I did wrong?"


The Solution(s):


1. The quick one!


Toggle VSync on in your game options.

Vsync On!

2. The longer (better?) one!


The issue is related to having the movement and animation updating from well, Update(). Update() is called once every frame and by its nature is variable in when it is called unless you are locked in with a VSync which limit's the calling of Update to the refresh rate of your monitor and is why the quick fix above works.

It is better, in my opinion for this tutorial series, to keep the input code within Update() but move the animation/movement code to within FixedUpdate() this occurs at a fixed interval determined by your project settings. Some sample code from my own PlayerMovement.cs is below. 

Excerpt from PlayerMovement.cs



Happy coding! :D

PappaP x

ASP.NET Core(porate) , yup I'm hilarious :|

 So, lately, I have been in full corporate mode. That means looking after my team of engineers and when I have some gaps in my calendar work...

Most Viewed