- Home /
Question by
ShaanTheMan · Apr 08, 2018 at 12:07 AM ·
rotationscripting problemrotatebeginner
How can I rotate an object to be perpendicular to a surface it hits (in 2D);
I'm making a mobile game, and I want to make the player rotate to be perpendicular to the object that it hits.
Comment
Answer by Karsten · Apr 08, 2018 at 06:32 AM
Assuming you know the rotation of the surface that has been hit you set the player rotation to the same like the surface that has been hit and add 90 degree to the z axis rotation of the player.