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

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

Asked by 7 years ago
Edited 7 years ago

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

01player = game.Players.LocalPlayer
02tool = script.Parent
03throwable = true
04mouse = player:GetMouse()
05 
06function shoot()
07    if throwable == true then
08        throwable = false
09        local kunai = game.ReplicatedStorage.kunaiProjectile:Clone()
10        kunai.Parent = workspace
11        kunai.CanCollide = false
12        kunai.CFrame = tool.Handle.CFrame
13        kunai.CFrame = CFrame.new(kunai.Position, mouse.Hit.p)
14        local bv = Instance.new('BodyVelocity', kunai)
15        bv.Velocity = kunai.CFrame.lookVector * 230
View all 22 lines...
0
A BodyGyro should do the trick: http://wiki.roblox.com/index.php?title=API:Class/BodyGyro mattscy 3725 — 7y
0
do you have any hints on how i would go about using one? PoePoeCannon 519 — 7y
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 mattscy 3725 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
1kunai.Orientation = bv / 230
Ad

Answer this question