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

Can I create paths that are being constantly moving

Discussion in '2D' started by Stew_79, Apr 21, 2021.

  1. Stew_79

    Stew_79

    Joined:
    Feb 24, 2021
    Posts:
    36
    Hi guys
    I will try an explain this a bit
    I have created a 2d space shooter in which the camera is constantly moving along the x axis.
    My background elements, once out view of the camera simply flip back in front of it to create a continually scrolling background.
    I have then create a few paths for my enemy objects to follow along.
    I then added a script to make these paths move with the camera along the x axis.
    The problem is that when I instantiate my enemy objects they only follow their paths at the original positions where I create the paths and not where I am at that point in the game.
    I used this tutorial to create my paths Unity Movement Paths Part 2 - YouTube
    I hope this makes sense to someone?
     
  2. Cornysam

    Cornysam

    Joined:
    Feb 8, 2018
    Posts:
    1,343
    Try something like this:
     
  3. Stew_79

    Stew_79

    Joined:
    Feb 24, 2021
    Posts:
    36
    @Cornysam thanks.
    however I have managed to get a bit further resolving my issue kinda. But now I have another problem that's confusing me. If you watch the video in the link below here. I spwan 1 Boss enemy but some how end up with 2 on the screen.
    I think he second one is blocking the first I'm not sure yet. I need to figure out why I have 2 Boss enemy's instead of 1
     
  4. Stew_79

    Stew_79

    Joined:
    Feb 24, 2021
    Posts:
    36
    I have now manged to resolve this issue thanks for the help anyway :)
     
    Cornysam likes this.