Single gun / Multi-bullet system ((Help))

So I tried that and it shoots 1 bullet on start which is good, but after upgrade pickup still only one bullet after upgrade 3 pickup still only one bullet. I’m also not sure how you got your condition on your bool/branch. I made a bool but cant use it on this as the options change once hooked up to AmmoType/Bullet01.

On upgrade I mean overlap ammo upgrade once, twice on stage.

just for kicks try disconnecting the class defaults from the branch and set it manually to true. see if it works then. i think you may not have the correct reference for your ammo type variable.

Yes that allowed me to shoot single bullet on start the every time I hit the ammo upgrade it ups the bullet count. Works great now. Not sure where I went wrong with the condition.

if it works now as it should then your variable type isnt right. if you select your variable and look at the details panel the variable type should be the same as the name of your bullet blueprint.

Var type says Actor Var Name is the same as my BP.?

whats the name of the blueprint you are spawning? i assume you created a blueprint for your bullet right? like in my case i created a BP that contains all the logic for my bullet and named it ammo. so the variable type that i selected is of the class ammo.

226558-ammo.png

My Bullet BP is called Bullet01 and is an actor bp.

yea thats true it is a actor but actor is just one layer of hierarchy. like lets look at the character class for instance. character is a class but it inherits from the pawn class so pawn would be a more basic layer. and pawn in turn inherits from the actor class. its like cars, you can say hey theres a car or you can further define it like hey theres a sports car. a sports car inherits the traits of car like having 4 wheels but its different because its further defined. if that makes sense
so in the variable type box type in bullet01

Okay so I went into the var type and searched for my BP and chose it as a class, now it has the same name as my BP. But when I get class defaults I have no outputs and the options are the same as before.

the option i have on mine from class defaults is a variable within the bullet01 blueprint. if your getting two bullets before collecting any upgrades then i would check the default value of numpickups variable it should be set to zero

the ones you see there are whats built into the class before anything is added. on mine it lists the variables ive made at the top under a defaults category because i havent added my variables to a category within the bullet blueprint. if you go into you bullet blueprint and select the variable which category is it in? with the get class defaults node selected your variable should be listed under whichever category its set to, given that the bullet bp is compiled.

Still trying to fix this, but can’t get any usable outputs from GetClassDefaults. Currently the player starts with one bullet moves forward and gets 2 bullets, then you must hit an upgrade to get 3 bullets. Why am I getting 2 on moving forward. That’s not part of the script. ??

I’m wrong, it fires 2 bullets after a time frame. Still not part of my scripting.

Ya, the bullet thing was lack of CastToPlayer, other enemies were hitting the upgrade. But I have IsMultiShootable as a bool in the BulletBP When I go to select the output options, I have none of the bools in the BulletBP, instead I get weird random outputs that I didn’t make (guessing it’s “defaults”)

I am not sure how to change Categories. It only has Default.

226636-help07fw.png

I was wondering too if version was the issue. Thanks for all your help though. I do appreciate it. I might just mess around and see what I can change.

hmmm im at the limit of my knowledge on this one the only other thing i can think of is that the issue could lie in the different versions of the engine we are using. the post says your on 4.15 and im on 4.17. im sure there must be another way to get the reference to the variable but im not sure how to do it.

the same basic script would work but you would need to just separate the multi shot from the single shot. or find a different way to tell it if multishot can be used. so say have a function that calls one or the other. or have a if ammotype = certain type then set true.