Here’s a short video showing the third iteration of my rigidbody based 3rd person controller for my Spring Term video game assignment, working title “Stoic SugarCubes”. While i’m still trying to come up with cleaner ways to do the basics like ground detection I currently have workable coding that, if nothing else, means this rigidbody based controller is viable for my project without having to rely on unity’s built in character controller.
How it works:
– Using gamepad inputs(I will be looking into making a mouse and keyboard alternative later) you use the left analog stick to rotate the player and then propel it along it’s local forward axis.
– Using the left analog stick you rotate the camera and use the left and right triggers to zoom in or out.
– The player’s rotation axis is determined using the cameras forward and right rather than the world vectors so the direction you move the joystick in matches up with what you see on screen.
– Using a boxCast downward the rigidbody detects the ground. Unlike a raycast this includes the object’s corners and avoids issues when the player is on edges or slopes.
– While not show in the video I have also tested out changing the player’s scale and have noted no problems so far with this and how it interacts with the world.
What to look into:
– I would like to fine tune the ground detection and add features to check if the object is surrounded for when I want it to shrink or expand the player.
– By using a raycast down I could detect and add a slope limit. I could also use this to orientate the player to the surfaces normal.
– Buoyancy in water and a bouncing feature to test the gravity.
– A gravity direction controller.