Slastraf Posted March 10, 2016 Share Posted March 10, 2016 I want to go 3D with my 2D Side scroller character controller. As you can see at the bottom I want to program a tourning controlIer. It is pretty much easy to explain but for me hard to think of how to approach this. I dont want to use hundreds of pivots for each angle thats for sure:) But what would be any good way to make this ? source: Quote Link to comment Share on other sites More sharing options...
Rick Posted March 11, 2016 Share Posted March 11, 2016 From watching that video, it's almost like there are 2 pivots. One at the start of where you want to rotate and one at the end and the amount of rotation that happens depends on the distance you are to that pivot. So maybe a way to do this would be to put a csg with invisible mat on it and set to trigger with a script attach around this entire area. Then put 2 pivots on the start and end of this area. When the player is inside the trigger and moving in the "right" direction check the distance from the end pivot and rotate a value based on that. If the player is moving "left" check the distance from the start pivot and rotate a value based on that. How to figure out how much to rotate by distance, I'm not 100% sure. I guess you'd figure out how much total rotation you want first. Then you'd figure out the total distance from the 2 pivots. That should tell you perhaps how much to rotate every 1 cm based on the distance each frame. Then use the Math:Curve function to make it smooth. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.