SpawnActor creating multiple copies on a DoOnce

When i fire a single arrow it works the first time fine, then after another keeps on being spawned. I am spawning to different arrow blueprints but the first one is spawning twice and that’s the problem i can’t fix, any help?

There seems to be another execution wire connected to the SpawnActor node, have you checked that?

That’s just a trace i had in-between the nodes nothing is executing that at the moment

Hello call95,

I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. Can you reproduce this issue in clean project?
  2. If so, could you provide a detailed list of steps to reproduce this issue on our end?
  3. Could you provide screen shots of any blueprints (complete execution line) that may be involved?

Just a quick update so i don’t seem unresponsive, thanks for the quick reply i’ve reproduced the problem in a blank project and will have time soon to make a video or better explanation with screenshots and a list of how to reproduce the problem. I’m starting to think the problem is that ‘Actor hidden in game’ isn’t working and the actors might be spawning correctly, because the second actor that spawns was a duplicate of the first actor but all the visible components we’re deleted and they still show up on spawn.

Hope this helps here’s some images of whats going on in the project
I’m spawning a visible projectile from close to my character then another that’s invisible from my players camera and blending the location over time of the visible to invisible, it works but for some reason the empty projectile blueprint has visible components.

Thank you for the additional information. Could you provide answers to the other two questions that I asked previously (Repro in clean project, Detailed repro steps)? This information will help eliminate extraneous information as well as allow me to reproduce this issue on my end.

I’ve reproduced the issue in a blank project and the screenshots are from that project. I’m not sure how detailed to go with a list of how to reproduce the issue but i’ll try to provide useful information.

• I created a new project

• I created a character blueprint with basic movement capabilities like that in the unreal third person tutorial

• I blocked out a basic character with cube components so i had something to look at and get the transform of

• I created an actor with basic shapes and projectile movement which i called ‘MyProjectile’

• I duplicated that projectile blueprint and called the new one ‘MyProjectileProxy’

• In the proxy blueprint I deleted the shape components so all it contained was ‘DefaultSceneRoot’ and the projectile movement and set ‘Actor Hidden in Game’ to true

• Then I used those projectile blueprints in the character blueprint shown in one of the screenshots

So ideally I spawn two actors and the one coming from the characters Cube1 location would move towards the proxy projectile which should be invisible, but that’s my problem the proxy projectile is showing shape components after they’ve been deleted

Hello call95,

Thank you for the additional information. Would it be possible for you to provide the blank project that was used to reproduce this issue? You could provide this via drop box or google drive.

Thanks for the response and yes should be on here.

https://drive.google.com/folderview?id=0BxCkzxgesamdaEpyaEMyelpaNUE&usp=sharing

After looking through your project it appears that your blueprints are working as intended. The reason that it appears as though your shots are doubling up is because you are setting the location of a bullet that was already fired to that of the newest one that is spawned. I noticed that the doubling effect never happens on the first shot and that when I shot the second time that the first projectile would seem to disappear when shooting the second or third. You will need to take a look at how/what projectile instance is being referenced when you are setting location. I hope that this information helps.

Make it a great day

Thanks again for the response I appreciate your help but this hasn’t solved my problem, I don’t think the project is working as intended. I’m spawning two different projectiles, one which has visible shape components (MyProjectile) and one which is basically empty and set to be hidden in game(MyProjectileProxy), but the proxy type which should be invisible isn’t and is showing components of the first type of projectile. It’s happening if you fire a shot after leaving it for a second or two.

Could you follow the steps below to run a quick test for me?

Steps:

  1. Open your player controller
  2. Add a pause game node and have it set to true when you press the ‘G’ key (example below)
  3. Play in Editor
  4. Fire your gun until you see the projectiles double up
  5. Press the ‘G’ key to pause the game
  6. Eject from your player
  7. Click on the two projectiles
  8. Notice that the two projectiles are both instances of “Myprojectile”

Example use of the Pause node

81540-pausegameexample.png

Example of how to eject

Screen shot of your project and it’s projectiles

Don’t think I’ve used the pause node before seems useful, thanks and yeah both of the projectiles in the test project are ‘MyProjectile’ not sure why two are spawning though, or why one of them is getting the location of the invisible projectile and still don’t have a clue how to fix it.

Just been messing about in my main project with this problem now, not fixed it yet but i get it what you were saying in your answer now, thanks a lot for help and pointing me in the right direction.

I took another look at you blueprints and found that you were not giving the projectiles their own proxy projectile to follow but you were instead telling the “MyProjectile” to follow the newest proxy projectile that was spawned. I have provided the quick changes that I made below as an example of how you could get around this flaw.

I created a new variable that is of the type Actor Reference. I then set this to the proxy projectile that was spawned at the same time that My projectile was created. I did this on begin play because this will only occur once (this means it will not update everytime a new proxy projectile is spawned)

I then made the following changes to the Follow independently function. This function now uses the Actor to Follow variable that I created and set earlier.

Make it a great day

Got some more errors to fix but this was easily the most frustrating one felt hopeless fixing it, don’t think i would have figured it out, thanks loads for your help Rudy, much appreciated.