- Home /
How to rotate a player around the corner of a box?
Hi guys,
This is my first post so I'm hoping someone can help me out with this. I am creating a 2d platformer and I want the player to walk over an edge onto a wall and create a smooth transition between 'grounds'. I was thinking about creating raycasts to detect if the player is leaving the edge then rotate but I'm not sure if it will be as smooth as I want. Maybe I should just use an animation for this so I can get the positioning and rotation right?
Any help or push in the right direction would be greatly appreciated. Thanks!
well what are you expecting the transition to look like, that will dictate whether you need an animation or not, you could set it up so that the character acts like the corner is actually curved with a particular radius or similar so they actually gradually go around the corner?
Do you have any links to behaviour that you want to mimic?
@Scribe I don't have a direct link unfortunately, but a rounded corner would definitely do. So if a player was moving around a rounded edge, would it be feasible to change the gravity while moving around the corner? I want to give the player control over movement around the corner. $$anonymous$$aybe sending two raycasts on both sides of the player, taking the average between the two and rotating the player acccordingly?
Your answer
![](https://koobas.hobune.stream/wayback/20220613200234im_/https://answers.unity.com/themes/thub/images/avi.jpg)