Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question What do I need to know?

Discussion in 'Physics' started by Proxyuto, Feb 7, 2023.

  1. Proxyuto

    Proxyuto

    Joined:
    Aug 2, 2022
    Posts:
    5
    I want to code a character controller that mimics the physics of "AER: Memories of Old." Does anyone have any hints or suggestions on what I should read up on? Stuff like, what physics theories should I read? What mathematical concepts should I brush up on? What terminology could be helpful to know? I've made character controllers that can walk, but not one that can seamlessly switch between flying and walking.

    If you've never played AER, I'll try to describe the feel of the character controllers' physics briefly. As I mentioned before, in AER you play as a character that can seamlessly switch between flight controls and grounded walking controls. You maintain momentum as you transition from one mode to another so there are no awkward mid-air pauses or stutters as the character switches controls. Ground controls aren't anything particularly special from what I remember since the game's focus is flying. Though one thing of note is that if the player walks off a ledge, the character starts tilting forward into a nose dive.

    In flight mode, you control kinda like an airplane, I think. If you try to pitch upwards, you lose speed, and if you pitch downwards, you gain speed rapidly. If you try to pull up from a nose dive, you slowly pitch upwards as if the character were struggling against the downward force that accumulated from the nose dive. The character never rolls over 180 degrees when turning left or right. And the camera can be rotated around the character at any time, so the direction of the controller's pitch, yaw, and roll are not dependent on the camera's view.
     
  2. Geckoo

    Geckoo

    Joined:
    Dec 7, 2014
    Posts:
    142
    At the start, you should say that it is a third person controller. Not so seamless but good enough. I did not see anything particularly in this transition. According to a single boolean, you could switch between controller mode. I don't think that a raycast in order to check the ground distance could be the best way (playing with the velocity maybe), but it could be a good starter. The best part is the animation transition - a nice make-up FX so as to hide some glitches :)
    Briefly I guess that you can find a good plane behavior in GitHub or somewhere else ++