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

I need body velocity to only shoot on x and z axis?

Asked by 6 years ago

So I made a ki blast type move. I want it to shoot to where the mouse is but not on the y axis, only on the x,z axis. I tried this, but it's not working please help!

v.Velocity= head.lookVector*330 + Vector3.new(mousehit.lookVector.x,0,mousehit.lookVector.z)

0
Try: Vector3.new(mousehit.p.x, 0, mousehit.p.z) KingLoneCat 2642 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

Instead of multiplying by 330, multiply by a vector with the Y component as 0:

v.Velocity = head.lookVector * Vector3.new(330, 0, 330) + Vector3.new(mousehit.lookVector.x, 0, mousehit.lookVector.z)
Ad

Answer this question