Aden_Rc
(aaden)
August 5, 2022, 2:57am
#1
I have a soldier NPC, which I want to be able to throw a grenade. I want the grenade to be able to be thrown with BodyVelocity like a real grenade and land on the target perfectly. How do I achieve this?
1 Like
You can use Bézier Curves .
Yes truely even i agree that bezier curve may help.
This is an a similar topic with a solution refer it.
Here’s a link that was posted on an earlier topic regarding projectile motion. There happens to be a section explaining how to model the path with a Beam effect.
> This guide was originally written for [scriptinghelpers](https://scriptinghelpers.org/). The original can be found [here](https://scriptinghelpers.org/blog/modeling-a-projectiles-motion).
As a somewhat active member of the Scripting Helpers discord one of the most common questions I see is how to have a projectile travel an arc. Most people want to know how to do this for things like basketballs or cannon balls and so forth. Since this is such a popular question I thought it would be worth writing a blog post on it and talking about a few other things we can extend from our findings.
## Table of Contents
* [Deriving the equation](#deriving-the-equation)
* [Basketball example](#basketball-example)
* [Jump power and height](#jump-power-and-height)
* [Mapping the projectiles path with a beam](#mapping-the-projectiles-path-with-a-beam)
## Deriving the equation
Using basic knowledge of physics and simple calculus we can derive the basic equation of motion that a projectile will take.
We know that the derivative of position with respect to time is velocity and that the derivative of velocity with respect to time is acceleration. Thus, the reverse is also true, the integral of acceleration with respect to time is velocity and the integral of velocity with respect to time is position.
In our case we know that the only acceleration affecting our objects is gravity. Therefore, all we must do is integrate gravity with respect to time twice to give us an equation for position.
![eq1](imgs/projectileMotion/eq1.png)
This file has been truncated. show original