Make force based on damage?

Hello,
I’ve been recently been making a sandbox gun game and I am making different types of shotguns, but like here comes the question: how can I make the bullet’s force be relative to the amount of damage the shotgun does? I basically need it so like if you shoot someone, the closer you are, the more damage it does, and the farther you fling the objective away. How do you create some type of “force” even? I am new to studio…

Force is instantaneous and applied once in a short amount of time in your case.

Therefore use part:ApplyImpulse() to apply instant force.

You could use .AssemblyLinearVelocity but that will overide the previous forces being set if there are multiple sources.

If its being applied to a player you will also need to change NetworkOwnership to be allowed to change the force.

To do damage or force drop off use a linear function

To measure distance for the above function you will need to use .Magnitude and get the vector between two points.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.