So I've been experimenting with 2.5D transitions in my 3D Sonic Game engine, I've always found the seamless transition from 3D to 2D and back a very impressive part of the boost formula games. Naturally, It's a difficult thing to design so I'd like to discuss how such a system should work, by outlining the goals and my approach to start.
Goals / Requirements
- The Player should be able to move from 3D to 2D and back without needing to stop or reset any controls
- Local Z axis needs to be locked/controlled by the 2D area
- Sonic still needs to move through the Z axis, Loops, rails, etc.
My method
Define the 2D space using lines and splines along the curves of the level geometry, after calculating the input effects in the physics update, take the ground velocity (this is velocity projected onto the ground plane) and lock it to the spline using a Vector3.ProjectPlane() and do the same to the location values.
Activate when Sonic intercepts a collider attached to the script.
Example code here.
This works as shown here
It's a bit off though and splines need to be set up very precisely else we get issues, if anyone has any other ideas let discuss
Goals / Requirements
- The Player should be able to move from 3D to 2D and back without needing to stop or reset any controls
- Local Z axis needs to be locked/controlled by the 2D area
- Sonic still needs to move through the Z axis, Loops, rails, etc.
My method
Define the 2D space using lines and splines along the curves of the level geometry, after calculating the input effects in the physics update, take the ground velocity (this is velocity projected onto the ground plane) and lock it to the spline using a Vector3.ProjectPlane() and do the same to the location values.
Activate when Sonic intercepts a collider attached to the script.
Example code here.
This works as shown here
It's a bit off though and splines need to be set up very precisely else we get issues, if anyone has any other ideas let discuss