Hello Guest

Author Topic: Slopes and 2dToolkit..  (Read 3121 times)

lrojas94

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Slopes and 2dToolkit..
« on: January 31, 2014, 03:08:13 am »
So, I've been trying to implement slopes in my game. They work with a character collider just fine, but I would like the character to align based on the angle of the slope, meaning he would have to rotate a bit. The point is, I managed to do it using Raycast to the floor and normals, but after this is done, sometimes (At corner for example), you will get infinite rotations, since after it rotates, the next  raycast hits where the base one was... keeping the sprite on an infinite loop going back and forth. Is there anything you would/could recommend to fix this? I would really appreciate it...

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Slopes and 2dToolkit..
« Reply #1 on: January 31, 2014, 11:22:38 am »
There isn't one magic solution to this. Might be worth looking at this 2D platform controller on the asset store, I believe it correctly handles slopes.
http://2dtoolkit.com/forum/index.php/topic,2185.0.html