Skip to main content
clarity
Source Link
hatinacat2000
  • 455
  • 1
  • 6
  • 25

I need to have two players moving in a level for a school project and my player controller is already set up for using axis inputs (as opposed to discreet buttons) for directional input. I already know I can assign custom key inputs from the inspector if I just declare a public variable (initialization optional because there is a drop-down list in the inspector):

public KeyCode jumpInput = KeyCode.Space;

How can I assign custom directional axis inputs from the inspector? I already have alternative horizontal and vertical axes defined in my preferences, I just need to know how to assign them.

Been putting this project together for 36 CONTIGUOUS hours and I am ready to put it (and myself) to bed. Thank you in advance for your time.

EDIT: Sloppy video of what I'm trying to do, watch as much or as little as you can stand:

Youtube My confusion was coming from (beyond being awake too long) thinking that I needed a special data type (like KeyCode) for an Axis, and couldn't find it in the reference. But I didn't consider making a public string and plugging that into the input. This way, I just need to know what I named the new axes and use that for the public string.

I need to have two players moving in a level for a school project and my player controller is already set up for using axis inputs (as opposed to discreet buttons) for directional input. I already know I can assign custom key inputs from the inspector if I just declare a public variable (initialization optional because there is a drop-down list in the inspector):

public KeyCode jumpInput = KeyCode.Space;

How can I assign custom directional axis inputs? I already have alternative horizontal and vertical axes defined in my preferences, I just need to know how to assign them.

Been putting this project together for 36 CONTIGUOUS hours and I am ready to put it (and myself) to bed. Thank you in advance for your time.

EDIT: Sloppy video of what I'm trying to do, watch as much or as little as you can stand:

Youtube

I need to have two players moving in a level for a school project and my player controller is already set up for using axis inputs (as opposed to discreet buttons) for directional input. I already know I can assign custom key inputs from the inspector if I just declare a public variable (initialization optional because there is a drop-down list in the inspector):

public KeyCode jumpInput = KeyCode.Space;

How can I assign custom directional axis inputs from the inspector? I already have alternative horizontal and vertical axes defined in my preferences, I just need to know how to assign them.

Been putting this project together for 36 CONTIGUOUS hours and I am ready to put it (and myself) to bed. Thank you in advance for your time.

EDIT: My confusion was coming from (beyond being awake too long) thinking that I needed a special data type (like KeyCode) for an Axis, and couldn't find it in the reference. But I didn't consider making a public string and plugging that into the input. This way, I just need to know what I named the new axes and use that for the public string.

added 154 characters in body
Source Link
hatinacat2000
  • 455
  • 1
  • 6
  • 25

I need to have two players moving in a level for a school project and my player controller is already set up for using axis inputs (as opposed to discreet buttons) for directional input. I already know I can assign custom key inputs from the inspector if I just declare a public variable (initialization optional because there is a drop-down list in the inspector):

public KeyCode jumpInput = KeyCode.Space;

How can I assign custom directional axis inputs? I already have alternative horizontal and vertical axes defined in my preferences, I just need to know how to assign them.

Been putting this project together for 36 CONTIGUOUS hours and I am ready to put it (and myself) to bed. Thank you in advance for your time.

EDIT: Sloppy video of what I'm trying to do, watch as much or as little as you can stand:

Youtube

I need to have two players moving in a level for a school project and my player controller is already set up for using axis inputs (as opposed to discreet buttons) for directional input. I already know I can assign custom key inputs from the inspector if I just declare a public variable (initialization optional because there is a drop-down list in the inspector):

public KeyCode jumpInput = KeyCode.Space;

How can I assign custom directional axis inputs? I already have alternative horizontal and vertical axes defined in my preferences, I just need to know how to assign them.

Been putting this project together for 36 CONTIGUOUS hours and I am ready to put it (and myself) to bed. Thank you in advance for your time.

I need to have two players moving in a level for a school project and my player controller is already set up for using axis inputs (as opposed to discreet buttons) for directional input. I already know I can assign custom key inputs from the inspector if I just declare a public variable (initialization optional because there is a drop-down list in the inspector):

public KeyCode jumpInput = KeyCode.Space;

How can I assign custom directional axis inputs? I already have alternative horizontal and vertical axes defined in my preferences, I just need to know how to assign them.

Been putting this project together for 36 CONTIGUOUS hours and I am ready to put it (and myself) to bed. Thank you in advance for your time.

EDIT: Sloppy video of what I'm trying to do, watch as much or as little as you can stand:

Youtube

Source Link
hatinacat2000
  • 455
  • 1
  • 6
  • 25

How to assign separate controller axes to Player1, Player2?

I need to have two players moving in a level for a school project and my player controller is already set up for using axis inputs (as opposed to discreet buttons) for directional input. I already know I can assign custom key inputs from the inspector if I just declare a public variable (initialization optional because there is a drop-down list in the inspector):

public KeyCode jumpInput = KeyCode.Space;

How can I assign custom directional axis inputs? I already have alternative horizontal and vertical axes defined in my preferences, I just need to know how to assign them.

Been putting this project together for 36 CONTIGUOUS hours and I am ready to put it (and myself) to bed. Thank you in advance for your time.