How to make knockback for bomb

How to get direction of the explosion

Well its based on how you script your bomb .

Have you looked at the Explosion class?

I guess he is making his own custom explosion.

Yes, I’m making my custom explosion.

Are you talking about custom visual explosion or custom knockback?

You could get the direction between the player and the part touched as a unit vector, and then apply velocity to the player using the unit vector to send the player in the correct direction.

Touched here will be not a good choice.

I’m talking about knockback that happen when people touch the explosion

Direction vector between two parts? , This might help you get the Direction from the bomb to character , then apply the velocity as that direction multiplied by speed.

3 Likes

I don’t understand the problem. Are you trying to simulate a custom visual explosion or a custom knockback? If you’re doing a visual explosion, you can just use the Explosion class and the property Visible to false. If not this then I don’t see a reason why you would want to create a custom knockback if it already exists.

Thank you very much, I’ll try this

I don’t want to use Explosion class, It’s do too much knockback

In that case, you can just change the BlastPressure of the explosion?

Yes, but i still don’t understand something about Explosion so i decided to create my own custom knockback

I think it would be best if you make use of the Explosion class. If not, you will have a hard time scripting it from scratch.

Anyway, I’ll just try to use my own custom knockback first, If it doesn’t work as i want, I’ll use Explosion class instead.

It shouldn’t be the hardest thing to make from scratch as theoretically you just need to apply velocity in the correct direction, but @GalaxySmediaCaster if there is something that you are confused about with the Explosion class we might be able to clear that up for you.

What I mean is its completely unnessessary. Furthermore, calculating the correct direction is the system of the explosion and that’s not the easiest thing in the world. If you you’re missing even the slightest calculation, the velocity from the explosion will feel off.

My problem is solved, Thanks
but i used this topic to study instead

Also thanks other for reply!

Have a nice day