XCVlll
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 963 |
|
|
| 20 Oct 2016 11:09 PM |
| would it be possible to create a parabola to cause a "gravity" effect on something being launched |
|
|
| Report Abuse |
|
|
Thedagz
|
  |
| Joined: 10 Mar 2012 |
| Total Posts: 798 |
|
|
| 20 Oct 2016 11:10 PM |
| yes it is possible but its much more realistic to use a actual gravity formula for that |
|
|
| Report Abuse |
|
|
XCVlll
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 963 |
|
| |
|
Thedagz
|
  |
| Joined: 10 Mar 2012 |
| Total Posts: 798 |
|
|
| 20 Oct 2016 11:12 PM |
| projectile trajectory works out pretty well you can look it up |
|
|
| Report Abuse |
|
|
XCVlll
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 963 |
|
| |
|
|
| 21 Oct 2016 12:13 AM |
I saw this post and I had tried something like this not too long ago. Its just physics (which im not good at im taking that class this year) I was just creating like bullet paths. You can run this code and see a block move
ag=192.6
function trajectory(angle,velocity,height) local v={} v.x=velocity*math.cos(math.rad(angle)) v.y=velocity*math.sin(math.rad(angle)) v.maxHeight=(v.y/2*ag)+(height or 0) v.time=(v.y/ag) if height>0 then v.fally=math.sqrt(2*ag*height) v.fallTime=v.fally/ag end if v.fallTime then v.totalTime=v.time+v.fallTime else v.totalTime=2*v.time end v.totalRange=v.x*v.totalTime return v end
function getPos(gunTraj,time) local pos={} pos.x=(gunTraj.x*time) pos.y=(gunTraj.y*time)+(.5*ag*(time^2)) return pos end
local barretTraj=trajectory(45,18000,4) local bullet=Instance.new("Part",workspace) bullet.Anchored=true for i=1,math.ceil(barretTraj.totalTime)*1000,1 do i=i/1000 local pos=getPos(barretTraj,i) bullet.CFrame=CFrame.new(pos.x,pos.y,0) wait() end
|
|
|
| Report Abuse |
|
|
|
| 21 Oct 2016 12:29 AM |
function getPos(gunTraj,time) local pos={} pos.x=(gunTraj.x*time) pos.y=(gunTraj.y*time)+(.5*-ag*(time^2)) return pos end
but oh well
|
|
|
| Report Abuse |
|
|