Full Rewrite of Movement and Camera Rotation using DI and Factory


  • With my previous build i was having an issue with WebGL builds. i was facing some problems with detecting touch support on mobile. SO i decide to rewrite the movement and camera control scripts from scratch
  • The new mechanism now uses DI using Reflex - https://github.com/gustavopsantos/Reflex
  • Created a PlatformDetector System which figures out what kind of device we are on - PC/WebGL PC/ WebGL Mobile/ Mobile. then injects the respective settings to all the controllers
  • Created a MovementSystem which depends on PlatformDetector to detect what platform we are on, Finds the correct MovementHandler and gets it from MovementHandlerFactory. The movement handler remains responsible for player movement, This essentially allowed me to create platform specific movement controls, Much cleaner, separate logic and full flexibility
  • Created a RotationHandler system which works like MovementHandler but handles rotation. Same features as Movement Handler
  • All the following and rotation related data stored in Scriptable objects for easier fine tuning and separating platform specific settings

Files

Web.zip Play in browser
5 days ago

Comments

Log in with itch.io to leave a comment.

This build was uploaded to test movement and rotation on mobile and they work perfect but not simultaneously. This should be fixed in future builds, probably EOD