Explosion push force relative to explosion center?

Hiwi. Thanks for reading.

Well. I really cant come up with an approach on how to achieve a push effect for all players standing near a custom explosion event.
I just want to push everyone in the direction opposite from the center of the explosion. Im trying to use a bodyMover maybe BodyThrust.
But I really cant understand math formulas, how to push each player on a related math.pi direction relative to the explosion…

Is there a better/easier approach to push them all without bodymovers and complex math that my brain can’t afford? :v

Anyone can help me? Thank you for reading :3

1 Like

One idea gives me is that maybe put an explosion and Parent it to whoever puts the explosion?

1 Like

oh… cheese… theres an explosion default thing in roblox… lel…

Yeah… well thats seems very easy to use… kinda makes me feel useless, I wanted to do something more custom. Its just Im having a very hard time scripting this same effect by my own and reading about it.
Any documentation that could help me to script it by my own instead of using that explosion thing that I never tried? Possibly that explosion thing will not fit my needs, so I wanna learn to code my own too :v
Meanwhile, that explosion thing, I guess solves my question :v

I’d suggest looking at LineForce if you wanted to create your own push effect for explosions

1 Like

mmh very useful! Thank you so much!

1 Like

There are a variety of methods to actually apply the impulse but you can get the normalized direction vector by simply doing

(PlayerPosition - ExplosionPosition).unit

That would create a direction vector to push the player away from the explosion. So a simple example would be

PlayersRootpart.Velocity += direction * someAmount
5 Likes

mmh… Seems very logic!
So I can just feed the bodythrust with the coordinate relative of the player minus the point of explosion coord…
Usually managing CFrames coords and positions gives me a headache, and using them is very simple once you know what u want… I dont know why I didnt tried it. Thank you so much! :3

1 Like