Hello, I'm currently trying to get my player to be able to seamlessly switch between a 2D and 3D world. Kind of like in Mario Odyssey. However, I'm having a few issues and would appreciate and help.


Inconsistent Animations when Switching from 3D to 2D

I'm encountering an issue with my character's animations when switching from 3D to 2D. Specifically, the "speed" parameter on the animation controller is constantly changing, causing the character to switch between idle and moving repeatedly. Additionally, the "Direction" parameter doesn't align correctly - moving North/South causes the character to face east, and moving East/West causes the character to face North/South. I'm using the Mecanim system for the 2D animations.


image




Character Getting Stuck in Floor When Spawned Too Close

Hello everyone,

I'm using "Spawn ORK Player" when switching to 2D. This spawns the player at the position of a game object. However, I'm encountering an issue where if the character spawns too close to the floor, they get stuck inside it. I've also tried using Spawn Points instead, but even with the 'Place On Ground' option disabled, I still encounter the same problem.


image
image

Any help or guidance you can provide to resolve these issues would be greatly appreciated. Thank you!


  • g35011 said: Specifically, the "speed" parameter on the animation controller is constantly changing, causing the character to switch between idle and moving repeatedly
    Could be due to different movement methods between 3D and 2D - e.g. 3D moving via character controller and 2D moving via rigidbody. Are 3D and 2D using separate prefabs for the combatant? In that case you can set up the Update Mode for each of the prefabs in the combatant's prefab settings. E.g. 2D being moved via rigidbody should use the Fixed Update mode.
    g35011 said: Additionally, the "Direction" parameter doesn't align correctly - moving North/South causes the character to face east, and moving East/West causes the character to face North/South.
    Make sure to use the right axis for your rotation. This largely depends on how your 2D parts are integrated into your scenes. E.g. if they're just like 3D stuff, just seen from the top, you should still use the Set Y Rotation options instead of the Set Z Rotation one used by the 2D tutorials.
    g35011 said: I'm encountering an issue where if the character spawns too close to the floor, they get stuck inside it.
    If the prefab's origin position (i.e. the local X/Y/Z=0, where your handle is usually placed) isn't at it's feet, you need to add a Spawn Offset in the combatant's prefab settings. Or adjust the prefab's setup.

    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • gamingislove said: Could be due to different movement methods between 3D and 2D - e.g. 3D moving via character controller and 2D moving via rigidbody. Are 3D and 2D using separate prefabs for the combatant? In that case you can set up the Update Mode for each of the prefabs in the combatant's prefab settings. E.g. 2D being moved via rigidbody should use the Fixed Update mode.
    After playing around with the rotation settings nothing seemed to work. However, I've found changing the Default Horizontal Plane fixes the animation issues, is there a way to change this dynamically?
    gamingislove said: If the prefab's origin position (i.e. the local X/Y/Z=0, where your handle is usually placed) isn't at it's feet, you need to add a Spawn Offset in the combatant's prefab settings. Or adjust the prefab's setup.
    I've tried both changing the Spawn Offset and raising the origin position but can't seem to get the result I want. It either spawns way to high, or in the ground with no in between.
  • g35011 said: However, I've found changing the Default Horizontal Plane fixes the animation issues, is there a way to change this dynamically?
    No, currently not.
    Mixing 3D and 2D will probably require to have the 2D still work on a 3D plane.

    As for spawning in the ground - how's the scene setup generally?
    It looks a bit like your 2D scene is in the ground, so the player might spawn correctly there, just the entire 2D part there being below the 3D ground.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thankyou. It looks like using 3D objects with 2D sprites could be a better option. However, I am facing an issue while transitioning to the '2D' scene.

    My 3D scenes have the camera at a 45-degree angle. Unfortunately, when transitioning to the '2D' scene I'm unable to change it to a 90-degree angle. Despite manually adding a Top Down Border Camera to my main camera in the '2D' scene, it keeps resetting to the 45-degree angle. Any advice or solutions would be greatly appreciated.

    Schematic
    Top Down Border Camera Component
  • Camera positions don't work when the camera control isn't blocked - well, they are used, but the camera control will immediately change the position again.

    For the camera control component's setup - change the distance to 0 to have it above the target.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.