Get projectile to fly out of hand

local function Activated()
	if Debounce then return end
	
	Debounce = true
	
	local Character = Tool.Parent
	
	Throw:Play()
	
	local Projectile = Handle:Clone()
	
	local BodyVelocity = Instance.new('BodyVelocity')
	BodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
	BodyVelocity.Velocity = Character['RightHand'].CFrame.lookVector * 100
		
	BodyVelocity.Parent = Projectile
	
	Projectile.Parent = workspace
	Debris:AddItem(Projectile, 5)
	
	wait(3)
	
	Debounce = false
end

Currently the projectile just flies into the sky upwards out of my arm. I’ve tried editing the velocity CFrame and what not, but can’t get the right angles

1 Like

If your RightHand is facing upwards that may explain it. The projectile will launch wherever the Hand points (according to your script).

If you want to set it to your desired point, you should change the LookVector of the projectile and then set the BodyVelocity to Projectile.CFrame.LookVector * 100.

1 Like

What do you mean by change the lookvector of the projectile?
robloxapp-20200109-1944212
This is how it looks atm, I can’t really change the position of the projectile (the shuriken)

1 Like

So it looks like you want it to follow the mouse. Basically you can change the LookVector of the projectile by using CFrame.

local mouse = player:GetMouse()

local Projectile = handle:Clone()

Projectile.CFrame = CFrame.new(Projectile.Position, mouse.Hit.p)

local bv = instance.new("BodyVelocity")
bv.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
bv.Velocity = Projectile.CFrame.LookVector * 100
bv.Parent = Projectile

Projectile.Parent = workspace

But on the off chance you want it to shoot where the player is looking, i think you can use HumanoidRootPart.CFrame.LookVector instead of Projectile.CFrame.LookVector (not that ive tried it).

Hope this helps

2 Likes