- Home /
Dodge movement - restrict movement of an object left and right
I am looking to move a first-person camera (attached to an object of a human character) which is currently fixed in position, such that the left cursor moves the camera/object very slightly to the left before quickly returning to its original fixed position, and likewise pressing the right arrow moves the camera/object slightly to the right before returning to it's original position.
Essentially I am looking to replicate a dodge action, whereby pressing the left and right arrows on the keypad can be used to make the player dodge small oncoming objects.
Would anyone have a script that would move a game object in this way?
Your answer
Follow this Question
Related Questions
Problem with player bouncing or jumping 1 Answer
Two problems One code 1 Answer
How can I drag a GameObject along a fixed line? 2 Answers
Trying to move an object between two points 2 Answers
Slowly move a GameObject on 1 axis, then destroy it. 1 Answer