generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Show path of trajectory?

Previous Thread :: Next Thread 
Badfitz100 is not online. Badfitz100
Joined: 03 Nov 2010
Total Posts: 12591
04 Sep 2015 09:56 AM
Anyone know of any good sources (preferably lua) to show the path of trajectory of an object?

And this bird you cannot change.
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
04 Sep 2015 10:08 AM
Verlet integration will probably be exactly what you need.
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
04 Sep 2015 10:50 AM
You can use the kinematic equations to calculate where an object will be at a certain time given an initial velocity and acceleration. Works fine for Roblox. You could combine that with stepped raycasting to get an accurate representation of a simple trajectory and where it will hit something.

https://upload.wikimedia.org/math/4/3/6/436357594271ec28379aa9b0e6342b5a.png

google for more info on those if it sounds appealing.

I used to have a module which used that very method to display a parts trajectory, but I've seem to have lost that since switching to a new computer. It would have been pretty convenient to show you :-((
Report Abuse
Badfitz100 is not online. Badfitz100
Joined: 03 Nov 2010
Total Posts: 12591
04 Sep 2015 10:50 AM
@Rofl

I'm terrible at those kind of equations unless I'm told which letter is what.

And this bird you cannot change.
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
04 Sep 2015 11:03 AM
U = initial velocity
V = final velocity
S = displacement from its starting position
A = the constant acceleration of the object, which is likely to just be gravity
T = time

Every variable should be assumed a vector barring time.
Report Abuse
Badfitz100 is not online. Badfitz100
Joined: 03 Nov 2010
Total Posts: 12591
04 Sep 2015 11:06 AM
v = u + (a*t)
s = (u*t) + 2/(a*t)^2
s = 2/(u + u)*t

v2 = u^2 + 2^(a*s)

s = u*t - 2/(a*t)^2

from my basic understanding, this is correct?

And this bird you cannot change.
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
04 Sep 2015 11:20 AM
Almost -

v = u + (a*t)
s = (u*t) + 0.5*(a*t)^2
s = 0.5*(u + v)*t
v2 = u^2 + 2^(a*s)
s = v*t - 0.5*(a*t)^2

You might only use a couple of those, really. I can write up a quick example of them in practice if you like.
Report Abuse
badfitz67 is not online. badfitz67
Joined: 03 Jun 2010
Total Posts: 13165
04 Sep 2015 11:24 AM
so what I do I do with it?

And this bird you cannot change.
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
04 Sep 2015 12:01 PM
Plug in the values of the object whose path you want to track.

function PosAfterT (part, t)
local startpos = part.Postion
local startvel = part.Velocity
local accel = Vector3.new(0,-196.2,0)
return startpos + startvel * t + 0.5 * accel^2
end

You could use a loop to recalculate with slight increments of time to draw the path it will take.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image