- Home /
How do I switch control values?
Hello,
So I'm making a simple platformer and I found out that under the input platform controller, if you set [sideways speed] to a negative value, you invert the left/right controls. The question I have is: How do I switch between a positive value and a negative value upon pressing a button like "M"?
Comment
Best Answer
Answer by RedCherryStudios · Aug 08, 2013 at 01:48 PM
Lets say sideways speed is by default.
sidewaysSpeed = 1;
Head to the input platformer controller script and add...
if(Input.GetKeyDown(KeyCode.M))
{
sidewaysSpeed = -1;
}
This number can be changed to suit your needs. :)
Your answer
Follow this Question
Related Questions
Character is pushed off platform only when moving 0 Answers
Inverting all light on trigger (2D)? 0 Answers
how to invert Alpha channel at runtime? 1 Answer
Unstick from platform 1 Answer
Platform Control 1 Answer