It might help if you told us exactly what kind of issue it is that your having.
Please post more information.
o yea sorry forgot about that Basicly its counting the ai in game im trying to make so when it detects 0 it will spawn more but testing with print string as you can see but soon as i kill one it prints the string instead of 10
Well if you only have ObjectCount set to 1, the first time you kill it will be 0 so your string will print.
its not set as one its set to 5
How is this being called? If you are calling it multiple times by accident this might cause problems.
its called when the actor dies
Can you post more screenshots, they help better than paraphrasing whats happening.
Yea Sorry Im New To Unreal Engine So Its Hard For Me To tell you the problem thanks for help here are new screen shot and also abit more desription
Im Trying to make it so when the player gets killed it takes 1 off the varible anad then when it reaches 0 it will print string for now until it works then it will spawn some more but it does it when i kill 1 instead of 10 or 5 iv tryed all difrent numbers
Ok so your Destroying the Actor first, that node needs to be the last thing called, otherwise it wont exist to be able to process the other nodes correctly.
Try using the Sequence node to control which nodes get called in what order.
still gives me the same error because soon as i kill one it plays string works
got a vid if this help sorry about quality on 360p :///watch?v=uopX0EpWwsc&feature=youtu.be
Also have an key set up for you to push that will print the value of that int.
that key doent work
Dont understand why this isnt working
That countdown system you have should be fired whenever you “kill” another actor? The reason it is not working correctly is because that code is on the NPC. It should be counting down in the Level blueprint or the Player blueprint. Each NPC will have that Object Count variable and it will be set to 10. Whatever is in the blueprint of one is in the blueprint of all copies and its children.
You’ll want to have ONE of those blueprints (Player or Level or Game Mode) keeping Count of how many Objects there are left in the level. Move the code there.
Well GamingAsh, there is one big problem with this, each AI actor will have it’s own seperate AI Count variable, so when an AI dies, it will decrease it’s own Ai count variable. So if you have 3 AI actors placed, and each has an AI Count of 10, when AI #1 dies, it will have AI Count set to 9, but AI #2 and 3 will still have their variable set to 10. There is also another problem, instead of setting AI count using the --, just set AI count to AI Count - 1. If you want there to be 1 AI Count variable instead of each AI having it’s own variable, store the AI Count inside of the game mode blueprint, and cast to the game mode when setting the variable.
Yeah you want to move the entire functionality into the gamemode and then call that event from the actor when it “dies”. Again, you would have found this solution a lot quicker with 1 post instead of 7.