Forum rules - please read before posting.

3d terrain games with 2d player in adventure creator.

I need help, the lion over there is in 2d and he walks floating in the air and I am not able to make him have gravity to walk over the bridge that is in 3d.

Also I can not have collision with any object whether 2d or 3d.

I tried a solution of invisible walls to limit the passage on the bridge without exiting through the sides, but I couldn't

https://uploaddeimagens.com.br/imagens/TWsd9B4

Comments

  • 2D characters in 3D games are possible, but you'll need to rely on 3D physics components so that they can react in a 3D scene.

    You'll need to use a Rigidbody instead of a Rigidbody 2D, a Capsule Collider instead of a Circle Collider 2D, etc.

    If you can share screenshots of the Player's Inspector, scene colliders, and Settings Manager, I'll see if I can spot the issue and give more specific advice.

  • I changed to Rigidbody from 3d in the player and the problem persists, strange is that even unchecked the function ''ignore gravity'' unchecked and in ''rigidbody '' use gravity'' unchecked also still the lion falls. By checking the ''ignore gravity'' function, the player floats again.

    I recorded two videos to show the problem.

    There is a sphere in the video that the player still crosses.

  • This warning appears;

    Leao1 cannot find Sorting Map to follow!

    -> AC debug logger
    UnityEngine.Debug:Log(Object, Object)
    AC.ACDebug:Log(Object, Object) (at Assets/AdventureCreator/Scripts/Static/ACDebug.cs:20)
    AC.FollowSortingMap:Start() (at Assets/AdventureCreator/Scripts/Navigation/FollowSortingMap.cs:130)

  • edited January 2023

    I had not used the box collider. I used it and it worked.

  • The Player component's Ignore gravity? option will override that of the Rigidbody - check that if you want gravity to be disabled.

    It also looks like your Player's origin is positioned at the centre of the sprite. Generally speaking, it's best for a character's origin to be by their feet - see the 2D and 3D player prefabs (Tin Pot and Brain2D) as examples.

    If you set your sprite's Pivot field to Bottom, it'll set its centre position to be around their feet. That should allow you to set the Player's Y-position to match that of the floor, making it easier to set their starting position in scenes.

  • I'm having a problem with severity in two cases. In the first video I used the same parameters as my Leao game with 2D sprites and 3D environment, I changed the sprites. The problem arises when the player climbs a ladder or hits his head on the side of the ladder or another object he becomes unbalanced
    and falls like a sheet of paper.

    In the second video, this is another game like the previous one, but everything in 2D, I used naveMesh and the player is spinning, I can't make gravity work.

    In the second video, this is another game like the previous one, but everything in 2D, I used naveMesh and the player is spinning, I can't make gravity work.

    Warnings that appear in the last video

    The PolygonCollider2D on Default NavMesh is not a Trigger.
    Man cannot find Sorting Map to follow!

  • when the player climbs a ladder or hits his head on the side of the ladder or another object he becomes unbalanced and falls like a sheet of paper.

    This is Unity's physics system at work. In the character's Rigidbody, Freeze Rotation on the X and Z axes to prevent them from rotating in those directions.

    Alternatively, replace your Rigidbody and Capsule Collider pairing with a Character Controller.

    In the second video, this is another game like the previous one, but everything in 2D, I used naveMesh and the player is spinning, I can't make gravity work.

    Use a Rigidbody 2D and freeze their rotation here as well. The NavMesh is not necessary if you're moving your character through direct control - just place down colliders on the floor to prevent him from falling. The Polygon Collider you're using is enough - just remove the Navigation Mesh component from it.

    The two warnings in the Console can be ignored, as least so far as these issues go.

  • it worked, thank you

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.