ill try it myself and see if it works then ill mark this solved!
always happy to help if it doesnât work =D
If multiple darts cannot be in collision with same baloon at the same time
Then you could give darts ID variable with increasing value
Like
Fire dart blablabla
Change ID variable of dart set to Adv
Change variable Adv add 1
And now you could just check if dart is in collision with baloon
And if balloon ID IS NOT EQUAL to dart ID
If so then you damage balloon and set balloon ID to dart ID
This way each dart will be able to hit multiple balloons but only once
And donât start with Adv 0
ahh. i see this is a strategy i think i used before =p
the (1 second) is a invincibility frame. it works but when it comes to fast firing weapons mose the bullets pass through enemyâs due to them being invincible
lemme try this ![]()
and see if it works.
Oh ur right, sorry TT. If urâs is a fast weapon, Iâd have to rework my code =P
This works but now i can no longer kill said bloons. what i mean by hit once is one dart passes through and then the next kills it/multiple
works but now slower projectiles or fire rates could hit twice,
oof, do you have many types of projectiles? If you do, maybe tweak the invincibility frames for each type.
(so the slower ones have a bigger invincibility frame, and faster have a smaller one =P)
yeah, i plan to have upgrades that increase projectile amounts, attack speed, pierce, etc.
it would take a while to set that up. if it is what i have to do i can do it. but ill just leave this unsolved in case of a better solution. :<
I tried it with slower bullets (it works) but canât use slower and faster at the same time =P Super sorry I couldnât be of assistance ![]()
In that case you need this
So, to make the bullet pierce without giving a hit object I-frames or hitting every frame, the easiest way is to give each object a unique ID, use said ID to mark that object as hit by the specific projectile, and make it so that the projectile canât hit previously marked objects.
The easiest way to do so is to use this extension that I created to automatically handle object IDs, then to add a structure or array variable to the projectile object.
Use the behaviors in the extension to give each enemy instance a unique ID (I recommend using the incremental ID behavior, it is less demanding, especially for more objects). Then, when the projectile hits the enemy, use the ObjID expression of the behavior to get the objectâs ID, and slot it into the array/structure name (it should look a little something like enemyHitID[enemyenemy.AutoIncrementalID::ObjID()]. Make that child variable a boolean, and then set it to true.
This marks the enemy as hit by that specific bullet, and during all of the next frames, it stops the projectile from hitting the enemy again.
If you want the piercing projectile to be able to hit the same enemy more than once, the easiest way to do so would be to simply toggle to above variable to false when the enemy is not in collision with the player.
Example event:
![]()
Thanks!
It works!
The same projectile canât hit the bloon but a different one can!
And it works with spreadshot.
I think this needs ability to decide how many hits object can take before object ignore bullet
While also add option for deciding how many hits bullet can deal before being destroyed
Damn i just realized that is just making HP for bullet
ANYWAY i would see your extension as great addition
If you would polish it i would next time share your extension instead of my way of doing it
It does seem to fail when multiple are stacked atop each other but im sure its easier to fix.
Oh yeah forgot to add the âfor each enemyâ to the event.
You could just replace the boolean variable with a number variable, and make the condition be âif hits < maxhitsâ
Maxhits being a different variable on the object.
Show me what you did
Cause my logic is for chain lighting and not piercing
So you did not need all of it
