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. Dismiss Notice

Question Making an item automatically appear in hand.

Discussion in '2D' started by Neomedus, May 28, 2020.

  1. Neomedus

    Neomedus

    Joined:
    May 14, 2020
    Posts:
    47
    I'm looking to make it so when my character picks up an item it appears in their hand, I know you can do this by going through every single item and linking it up to the character in the animation panel for all of the characters walking directions, but I'm looking to make all items attach to the same spot on a characters hand without needing to do this.
     
  2. GrizzlyPunchGames

    GrizzlyPunchGames

    Joined:
    May 21, 2020
    Posts:
    11
    You have to create empty game object "GO" as child of your hand positioned where your items should appear,
    Then you instantiate object on your "GO" Transform.position with function

    Instantiate(PickedObject,GO.Transform.position, GO.Transform.rotation);
     
    Neomedus likes this.