Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Getting my characters to shoot

Discussion in '2D' started by tbehnz, May 29, 2020.

  1. tbehnz

    tbehnz

    Joined:
    Apr 1, 2020
    Posts:
    1
    I am making a 2D game with spray and shooting attacks, but I don't know how to do that.

    I'm using the CharacterController2D component for my player, and even after applying the correction to the script's Flip function by a Brackeys video here -->
    it still doesn't work.

    How do I program my player to shoot, along with my bad guy to shoot on seeing me, and produce shots that deal damage?
     
  2. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    @tbehnz

    If you are watching tutorial then maybe watch it again and check all of your code - as Brackeys is pretty high profile Youtuber, his code most likely does work, or someone has corrected it in the comments...

    "I am making a 2D game with spray and shooting attacks, but I don't know how to do that."
    "...with my bad guy to shoot on seeing me, and produce shots that deal damage?"

    There is like 3-4 different questions without any context - how much of this you have already done in pseudo code or in C# code? If you don't yet have any code, maybe watch / read some tutorials first to get started?