How to make the Body Velocity only move in the x and z axis of the mouse

I’m trying to make projectile that goes towards the mouse but i’m not really sure how I would make it go towards the mouse only on the x and z axis.

This is the code for the body velocity

		local Vel = Instance.new("BodyVelocity",Projectile)
		Vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
		Vel.Velocity = (mouse.Position - HumanoidRoot.Position).Unit * 100

How would I make it go to where the mouse is but not up or down.

2 Likes

Nevermind, I fixed it right after this post by replacing Humanoid.Position with Projectile.Position.

1 Like

but how do we make it only Z and X tho?

Vector3.new(num,0,num)?

yea i already found it but i have to rewrite all the guns bc my current system doesnt works with those