Plenty of progress on Gym Empire this week but not a lot that really translates into anything tangible I can describe. I’ve been continuing to focus on the animation aspects in terms of stringing animations together to make activities look more realistic. In doing this I realised it was a good point to add in collision. Currently the characters walk right through each other and the environment, but in order to have believable animations I need to have them colliding.
To achieve this I’ve had to redesign the way the characters move. Originally I was using the transform.MoveTowards function (transform basically being the game object that needs moving). This moves the object from its current position towards a target position by changing its location each frame; however it ignores any kind of in game physics. Instead I am now apply a Character Controller component to all in game characters, even the non-player controlled ones, and using the method SimpleMove. This basically applies a velocity to the object to move it towards the target. This takes into account the physics in the game and therefore allows for collision.
Making this change has had the desired effect of using collision for the characters but it has had some adverse effects on how the characters move around. They move in an odd way and act odd in certain collisions. One crazy example is when a client approaches a treadmill, they trip over it and then start doing a weird angled head spin on it. It’s quite funny actually so I’ll tweet a gif of it but not the effect I’m looking for!
I foresee at least another week as I try to clean up some of the animation aspects before I move on to the next step, which will hopefully be getting things ready for an announcement trailer!
