• Hey! Register here to create your account, engage with the community, and talk about what is new!

Projectile tracking

PotatoMan671

New member
Joined
Apr 30, 2021
Messages
6
Reaction score
0
I want to make a grenade system using snowballs. How do I create the explosion at the snowball?
 
Solution
As long as you're using Player Action: Launch Projectile, then you can detect when the projectile lands by using Player Event: Projectile Hit. Then, after some validation stuff to check if it's the grenade and not any old projectile, you can just use a Game Action: Create Explosion at that location and it should work! Let me know if you have any questions.

General_Mudkip

Retired Moderator
Overlord
Joined
Sep 6, 2020
Messages
362
Reaction score
95
As long as you're using Player Action: Launch Projectile, then you can detect when the projectile lands by using Player Event: Projectile Hit. Then, after some validation stuff to check if it's the grenade and not any old projectile, you can just use a Game Action: Create Explosion at that location and it should work! Let me know if you have any questions.
 
Solution

EvilsSouls

Forum adept
Overlord
Joined
Apr 16, 2021
Messages
208
Reaction score
18
or you can if you do it as a game action repeat multiple times (600 for 30sec in ticks) and than in the repeat multiple times do a select object all entitys by the name <projectile name>(you have to do in spawn proj, also a custom name in it) if entity is groundet game action spawn primed tnt
 

EvilsSouls

Forum adept
Overlord
Joined
Apr 16, 2021
Messages
208
Reaction score
18
or you can if you do it as a game action repeat multiple times (600 for 30sec in ticks) and than in the repeat multiple times do a select object all entitys by the name <projectile name>(you have to do in spawn proj, also a custom name in it) if entity is groundet game action spawn primed tnt
and after the if do a wait 1 tick (i said you should do that it gets repeated for 600 ticks (or 30sec) because a projectile that isn't a fireball (that is effected by gravity) is gonne be in the ground already after the 30 sec)
 

General_Mudkip

Retired Moderator
Overlord
Joined
Sep 6, 2020
Messages
362
Reaction score
95
and after the if do a wait 1 tick (i said you should do that it gets repeated for 600 ticks (or 30sec) because a projectile that isn't a fireball (that is effected by gravity) is gonne be in the ground already after the 30 sec)
I wouldn't recommend doing it that way unless you have to use Game Action: Launch Projectile as it's highly inefficient, and even then there are better solutions, such as starting a process and using a Repeat While: Not Grounded.
 

EvilsSouls

Forum adept
Overlord
Joined
Apr 16, 2021
Messages
208
Reaction score
18
I wouldn't recommend doing it that way unless you have to use Game Action: Launch Projectile as it's highly inefficient, and even then there are better solutions, such as starting a process and using a Repeat While: Not Grounded.
yea, you could do it like that, and i agree that it is ineffient, but i had some problems often with if proj is groundet not, so that why: ik it's ineffient, but it kinda works so (but still if you don't need to, than always use player action)
 
Top Bottom