I’m trying to create a script that will make the avatar character instantly walk right or left from the push of the A or D key, instead of turning. And Also make it so I can’t face the direction when I push the W and S key. Sorry if I’m confusing some of you. I can go into more detail if needed.
Basically if I go right and want to press the S key to go down I will, but my character still faces right.
There are two things you could do:
- Edit the player module (I would not recommend this as updates can easily brick your code)
- Detect if the player presses S while facing X direction, then do some math to face the character right whilst they move back
I’m assuming if you want to change the player module, you would want to find the code where the player moves and changes directions, and possible alter the code to keep the same Z Rotation from the CFrame.Angles position, Im not sure though as Ive never messed with the player controller
For the second option, you would want to use something like UserInputService, and detect InputBegan. If the key is S, then save the current humanoids rotation, and keep that rotation the same whenever the player is moving down.
Im not sure if any of this will work, this is just my best guess at what actions you can take to achieve this