How to throw 3 objects straight, after throwing the 4th make disappear

From a first person perspective.

Can you object in Unreal how would I make that go straight until it hits something? What are the different ways of doing this too?

If 3 objects have been throw/shot using a button After throwing the 4th thrown/shot, how do make the 1st object thrown/shot disappear? And then then the second one and so on?

Can you make the object stick to whatever it hits?

something like that should work just add your actors and events, note its conversions to string to compare variables(just type ‘to string’ in the search when dragging off the node). to make it stick, you could try disabling the physics simulation on an overlap event, but not 100% if that will work as anticipated

Hello MattStH,

To your first question: Yes and there’s a rather simple built-in solution too, you can use the ‘Projectile Movement Component’, which would be the simplest one, because you don’t have to code, and you get a bunch of parameters to tweak. There are other one’s of course, just let me know if you want an other.

297264-projectile-movement-component.png

To your second question: Why not cycle through 3 set projectiles? You can place three of them in the world, and make them level static, or just spawn the required amount of projectiles at the beginning of the game. My question would be if they should also disappear while they’re still flying through the air or not?
But you can also go the fully dynamic way, bear in mind though this won’t be as performant as the above mentioned way. Here I went with the latter one (this is the player blueprint):

To your third question: Yes, you’d deactivate any physics simulation on the projectile and attach it to the hit component.
This is my Projectile Blueprint:

Just a side note regarding jonukrah’s solution; I highly discourage the use of the ‘Get all Actors of class’ node, as this node’s computation cost increases with the amount of actors in your level, and if you’re already tracking the amount of projectiles you don’t really need it either. I also highly discourage the use of string comparisons, as they’re notoriously slow.

That said my code, isn’t bug free either, and I’d still go with the the cycle-through-level-static-projectiles solution. But this is the fast and dirty (not as performant) way.

Hope that helps. Just let me know, if you need help, or if you have any questions.

Regards,

Vecherka.