Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

My projectile is facing sideways, how can i turn it?

So i made a projectile script because i am making a throwing kunai knife.

I got it to throw in the direction of my mouse, but the kunai is turned sideways ( it looks kinda funny, but not very effective)

So the problem isnt the kunai flying in the right direction the problem is that I can't figure out how to turn the actual model of the kunai to face forward

here is my local script inside of the tool

player = game.Players.LocalPlayer
tool = script.Parent
throwable = true
mouse = player:GetMouse()

function shoot()
	if throwable == true then
		throwable = false
		local kunai = game.ReplicatedStorage.kunaiProjectile:Clone()
		kunai.Parent = workspace
		kunai.CanCollide = false
		kunai.CFrame = tool.Handle.CFrame
		kunai.CFrame = CFrame.new(kunai.Position, mouse.Hit.p)
		local bv = Instance.new('BodyVelocity', kunai)
		bv.Velocity = kunai.CFrame.lookVector * 230
		bv.MaxForce = Vector3.new(math.huge, math.huge, math.huge)		
		wait(.7)
		throwable = true
	end
end

tool.Activated:Connect(shoot)


3 comments

0
0

do you have any hints on how i would go about using one?

0

I don't have time to go into a full answer now, but this page has an example: http://wiki.roblox.com/index.php?title=BodyMover#BodyGyro

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.