- Home /
How do I script Street Fighter style movement?
I'm relatively new to scripting, but I'm looking to create controls for a fighting game.
I wish to have a 2D, side view control scheme(using Joystick axes, setup in Input Manager), where Horizontal-/+ equal move left/right, and Vertical-/+ crouch/jump respectively. Street Fighter style controls, essentially.
What would be the simplest way to go about this?
Examples are welcome :)
Teaching you how to write code is outside the scope of Unity Answers.
Answer by creighcl · Jul 16, 2013 at 12:43 AM
Unity Input Reference http://docs.unity3d.com/Documentation/ScriptReference/Input.html
You can move GameObjects in 2d space in different ways, you can change the x,y,z position of your objects, use translation or physics.
There are a lot of Unity tutorials out there, most of which will cover simple move mechanics early on. Good luck!
[2]: http://esotericsoftware.com/
Thank you. Sorry, I should have mentioned that I had already done most of the movements, but am having trouble with the jumping. Because it's calling every frame(update function), it keeps wanting to repeatedly jump. With a Rigidbody it keeps giving me a jagged, jittery jump, as it keeps trying to jump vs. gravity, until it inevitably loses out.
If I use GetButtonDown, such as with the keyboard, I can make it so it only jumps on the frame the button is pressed, but I can't seem to find a way to do that with joystick axes specifically.
How would I go about applying the GetButton Up/Down/Held functionality to joystick axes?
Your answer
Follow this Question
Related Questions
how can I assign and use different controller schemes for a single keyboard? 0 Answers
How to Attack using Animation and Input 0 Answers
arcade stick input commands implementation 1 Answer
How to get stick == neutral using new Input System 0 Answers
Find out if any Button on any Gamepad has been pressed and which one 6 Answers