Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How Would I Make a Projectile Ignore Gravity?

Asked by 5 years ago

I am currently working on a tool that fires an unanchored part outwards in the direction of a user's mouse click (using the parts velocity property). The problem is that it always arcs downwards due to gravity (despite being "Massless" which makes no sense to me). Is there a way to make the part ignore the effects of gravity regardless of the direction it is being fired?

1 answer

Log in to vote
1
Answered by
DanzLua 2879 Moderation Voter Community Moderator
5 years ago

You can create a bodyforce instance and sets its Y axis force to counteract its weight.

To do this we take its mass using :GetMas() and multiply that by roblox's gravity.

BodyForce.Force=Vector3.new(0,part:GetMass()*workspace.Gravity,0)
0
Thanks so much! corncob567 275 — 5y
Ad

Answer this question