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

Using mass and angle to determine force on an object?

Asked by 6 years ago

"Target" is the object the player throws, and "tool" is the thing the player holds.

local Mass = Target:GetMass()
local Angle = GetAngle:InvokeClient(Player)
local BodyForce = Instance.new("BodyForce")
local VectorDirection = Tool.Glower.Position - Target.Position
BodyForce.Force = (VectorDirection.Unit * (-2000 - (Mass * 100))) + Vector3.new(0, 1000 + (Angle * -1000), 0)

I'm trying to throw an object a specific distance. The higher the angle of the tool, the further the object, or "Target," should get thrown. The lower the mass, the further the object, or "Target," should get thrown.

This does throw the object but low mass objects get thrown very far away and with a very high arch. Any suggestions on what I can do to make this work more efficiently and consistently, taking into consideration the mass of the object and the angle of the throw?

1 answer

Log in to vote
0
Answered by
Synth_o 136
6 years ago

Alright again I have said this to multiple people but you should really start looking at some of the Blog posts, they go into a lot of depth and explain everything you want to know. Anyways this link could benefit you:

https://scriptinghelpers.org/blog/modeling-a-projectiles-motion

Ad

Answer this question