Slastraf Posted March 28, 2016 Share Posted March 28, 2016 I want to make the player always walk into the direction it looks with the setinput function. If you rotate it and call SetInput(0,4,0) it will walk +4 on a particular axis (in this case z ?), it will set the player rotation to 0 while walking and not walk into the front. What would be some math to fix this ? Quote Link to comment Share on other sites More sharing options...
Genebris Posted March 28, 2016 Share Posted March 28, 2016 SetInput already moves player in his local axis. First parameter is rotation angle, don't set it to 0, set it to angle you want player to look at. And second parameter will move player forward in that direction. Check out default FPSPlayer script, it sends camera rotation as first parameter, z input as second and x input is third. 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.