Announcement

Collapse
No announcement yet.

[Question] Spawning Object/Actor after goal reached

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [Question] Spawning Object/Actor after goal reached

    Hello,

    I've been having a hard time getting an object to spawn after reaching a certain goal. I'm working on the Endless Runner tutorial, and I wanted to add extra functionality to it. I wanted to make an actor spawn behind the player after you collect a certain amount of coins.

    I created a function that determines the total coins needed for the goal to be reached (so I thought anyways)
    Click image for larger version

Name:	Reach Goal.jpg
Views:	1
Size:	287.7 KB
ID:	1169826

    And then I made it reference the Enemy Spawning blueprint I created
    Click image for larger version

Name:	SpawnEnemy.jpg
Views:	1
Size:	333.1 KB
ID:	1169827

    When I reach the goal that I set, it's not spawning my object. As a place older I made a Cube that has projectile functionality and projects forward. I'm not sure if perhaps it is firing, but at a location where I can't see it happening. How would I make it so it spawns directly behind the player? I had set up 3 spawn points where I thought they would spawn from, but it's not happening.

    #2
    Originally posted by Iwintb View Post
    Hello,

    I've been having a hard time getting an object to spawn after reaching a certain goal. I'm working on the Endless Runner tutorial, and I wanted to add extra functionality to it. I wanted to make an actor spawn behind the player after you collect a certain amount of coins.

    I created a function that determines the total coins needed for the goal to be reached (so I thought anyways)
    [ATTACH=CONFIG]73067[/ATTACH]

    And then I made it reference the Enemy Spawning blueprint I created
    [ATTACH=CONFIG]73068[/ATTACH]

    When I reach the goal that I set, it's not spawning my object. As a place older I made a Cube that has projectile functionality and projects forward. I'm not sure if perhaps it is firing, but at a location where I can't see it happening. How would I make it so it spawns directly behind the player? I had set up 3 spawn points where I thought they would spawn from, but it's not happening.
    Not to be rude but I have no idea what that script is.

    What it should be though is you should use IF node to check if no of coins equals no of goal and then spawn the enemy directly, you don't need a spawner

    Comment


      #3
      I am going to assume Add Coin increased your total coins. Right now your ReachCoin() isn't doing anything, all it is doing it sending a 0 or 1 Int? value if Total Coins == 5. It is also unnecessary IMO

      In your AddCoin() do +1 TotalCoins, +1 CoinGoal then put a Branch

      If CoinGoal == 5 then Spawn Enemy -> Set CoinGoal = 0 return else do nothing Return
      Last edited by DEDRICK; 01-08-2016, 02:09 PM.

      Comment


        #4
        Awesome, thanks guys.

        Comment

        Working...
        X