Forum rules - please read before posting.

2D Direct Movement, Player Collider Problems

Hi,

I am very new to adventure creator and programming in general. I am planning to make a 2d Game and I followed the tutorial but I don't want to move point and click but with the keyboard and a controller.

I know the navmesh wont work for this, and I have to use the 2d colliders.

I added both a Rigidbody 2D and a Box Collider 2D to the player. However I am having problems with the collisions, sometimes it collides, sometimes it bounces and rotates.

I found out that the Player's 2D collider is rotating as I move up and down, and if I move left or right it it rotates in a way that the collider dissappears 

image
Without moving, the Box collider 2D is there.

image
The collider 2d is rotated and not visible. Does not collide.

Is there a way to make the player not rotate when I move? Or should I be using 3d colliders instead?

Comments

  • In which version of Unity and AC?

    You should first replace your Box Collider 2D with a Circle Collider 2D - the box is better suited to the "click area" for Hotspots.  Make sure that Is Trigger is unchecked, and that Ignore gravity? is checked in your Player Inspector.

    You should find that the included 2D demo player, Brain2D (/Assets/AdventureCreator/2D Demo/Resources), is able to work in this manner.  Try disabling your current player and drag Brain2D into the scene to confirm he works the way you intend.  Assuming he does, you can then compare the two player prefabs to see the difference.
  • edited April 2016
    Thanks for the answer Chris, I had no idea that Brain2D was also set up for direct control movement too! It has helped me a lot to study that prefab.

    So, you were right the problem was the Box Collider 2D I was using. Because the Box Collider 2D is basically a "sheet of paper" when it was rotating to 90 degrees in the Y axis it disappeared. 

    With the Circle Collider 2D everything works just fine.

    Btw, I was using AC version 1.51d but I just updated to AC 1.51e today, and .Unity 5.3.4f1
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.