Missile Spawn Issue

Not favoritedFavorited Favorited 0 favourites
  • 3 posts
From the Asset Store
Lasers, Blasts, Beams, Bullets, & Missiles! AAA quality Energy FX for your game.
  • The image below shows my events:

    The hero character has the Scroll To behavior, and my layout is larger than the viewport. I’m spawning 3 missiles from above the viewport and using the Bullet behavior to make them fall to the ground.

    Issues:

    1. If the spawn layer has 100% parallax, the missiles won’t spawn above the player if the player has moved beyond the viewport. They simply spawn in the viewport, and the player can’t even see them.

    Video: webmshare.com/play/PJaJe

    2. If the spawn layer has 0% parallax, the missiles correctly spawn above the player, but they follow the player as he moves. The same thing happens to the blast animation that is spawned when the missile is destroyed.

    Video: webmshare.com/play/5JoJB

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • If you want to spawn the missiles at the player's current location, then use player coordinates instead of fixed values.

    For example:

    Create missile at (Player.x, Player.y-200)
    Create missile at (Player.x-300, Player.y-200)
    Create missile at (Player.x+300, Player.y-200)
    

    Or, you can spawn them relatively to the viewport:

    Create missile at (ViewportMidX("layer"), ViewportTop("layer")-80)
    
  • If you want to spawn the missiles at the player's current location, then use player coordinates instead of fixed values.

    For example:

    > Create missile at (Player.x, Player.y-200)
    Create missile at (Player.x-300, Player.y-200)
    Create missile at (Player.x+300, Player.y-200)
    

    Or, you can spawn them relatively to the viewport:

    > Create missile at (ViewportMidX("layer"), ViewportTop("layer")-80)
    

    Thanks, you are a lifesaver...

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)