lskid
|
  |
| Joined: 07 Dec 2012 |
| Total Posts: 89 |
|
|
| 01 Apr 2017 04:00 PM |
So I need to launch a projectile to where the cursor is pointing, how can I do this in the Y axis only? It needs to go on a line from one part, to where the cursor points.
Lskid |
|
|
| Report Abuse |
|
|
|
| 01 Apr 2017 04:00 PM |
| What do you mean by in the Y axis only? |
|
|
| Report Abuse |
|
|
| |
|
lskid
|
  |
| Joined: 07 Dec 2012 |
| Total Posts: 89 |
|
|
| 01 Apr 2017 04:02 PM |
I already have it traveling by X and Z, but I am having trouble making it go in the Y towards it as I used a method for X and Z that wouldn't work here.
Lskid |
|
|
| Report Abuse |
|
|
lskid
|
  |
| Joined: 07 Dec 2012 |
| Total Posts: 89 |
|
|
| 01 Apr 2017 04:03 PM |
graveyard, you have no idea what I want or how to make it happen. That will not make it go towards the part unless the projectile starts at 0,0,0
Lskid |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Apr 2017 04:17 PM |
As in you're given the y position and the initial y position and you want to get the y component of velocity to launch it in? i.e.: puu DOT sh SLASH v64Lm SLASH 583e9f4608 DOT mp4 |
|
|
| Report Abuse |
|
|
|
| 01 Apr 2017 04:19 PM |
| well if you're talking about an arc then you should be using a projectile formula that accounts for x,y, and z |
|
|
| Report Abuse |
|
|
Dominical
|
  |
| Joined: 04 Nov 2011 |
| Total Posts: 1303 |
|
|
| 01 Apr 2017 04:20 PM |
If what you mean is that the projectile is falling while it's being launched then you need to create a force to keep it in the air. "Anti-gravity" in a way.
Here's how you would accomplish this: local bodyForce = Instance.new('BodyForce', part) local gravity = 196.2 bodyForce.force = Vector3.new(0, part:GetMass() * gravity, 0) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Apr 2017 04:21 PM |
| Oh yeah that's what he wanted woops. I just reread the thread. |
|
|
| Report Abuse |
|
|
lskid
|
  |
| Joined: 07 Dec 2012 |
| Total Posts: 89 |
|
|
| 01 Apr 2017 04:59 PM |
I am launching a projectile from a to b
B is higher than A, so it must move up by the time it gets there...
Lskid |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Apr 2017 05:00 PM |
Do his force idea and then for the y component of velocity set it to disp.Y/t And t can be gotten from disp.X/vel.X (or disp.Z/vel.Z), the same way you had did it before |
|
|
| Report Abuse |
|
|
lskid
|
  |
| Joined: 07 Dec 2012 |
| Total Posts: 89 |
|
|
| 01 Apr 2017 05:02 PM |
I need to calculate what the Velocity needs to be set to, stop talking if you don't know what it is you are trying to talk about
Lskid |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Apr 2017 05:02 PM |
| I already told you. Not my fault you don't understand basic high school physics and vectors. |
|
|
| Report Abuse |
|
|