Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

2D Co-Op?

Discussion in '2D' started by divinefury5, Oct 27, 2015.

  1. divinefury5

    divinefury5

    Joined:
    Oct 27, 2015
    Posts:
    1
    I have a Idea for making a Co-Op game but i want it to be on 1 keyboard like fighting each other can someone help me? i need to have 1 more player with differnt movement keys
     
  2. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,384
  3. VorpalSilence

    VorpalSilence

    Joined:
    Oct 22, 2015
    Posts:
    13
    Based on your message I assume you already have a game with 1 player object that can move around your scene based on keyboard input. At the most basic level, all you need to do is duplicate that same player object in the scene, create a new input script called something like 'player2input', copy paste your existing input code and just change which keys need to be pressed and then attach that to your second player object after removing the first input script from it.

    There are of course better ways to do this, but it would be a starting point.
     
    theANMATOR2b likes this.