I want to make it travel at a slight curve, see the image attached, and in the direction which it is facing, I don't know how to do that can someone help me?
I got it to do the curve I wanted, but it only goes in one direction https://gyazo.com/b9ae87b361d0b2c909f7d03e87b8d048
local mouse = game.Players.LocalPlayer:GetMouse() mouse.Button1Down:Connect(function() local f = game.ReplicatedStorage.Flare:Clone() f.Parent = workspace f.CFrame = script.Parent.Parent:WaitForChild("HumanoidRootPart").CFrame + Vector3.new(0,5,0) end)
This is messy because you're using CFrame and Position and Orientation. This is not needed because CFrame is position and orientation.
local mouse = game.Players.LocalPlayer:GetMouse() local TweenService = game:GetService("TweenService") local goal = {} goal.Position = Vector3.new(f.CFrame.upVector*250 + f.CFrame.lookVector*500) local tweenInfo = TweenInfo.new( 3, -- Time it takes to tween (I think) Enum.EasingStyle.Linear, -- EasingStyle Enum.EasingDirection.Out, -- EasingDirection 0, -- RepeatCount (when less than zero the tween will loop indefinitely) false, -- Reverses (tween will reverse once reaching it's goal) 0 -- DelayTime ) mouse.Button1Down:Connect(function() local humanoidrootpart = script.Parent.Parent:WaitForChild("HumanoidRootPart") local f = game.ReplicatedStorage.Flare:Clone() f.Parent = workspace f.CFrame = CFrame.new(humanoidrootpart.Position,humanoidrootpart.Position) + Vector3.new(0,5,0) TweenService:Create(f,tweenInfo,goal) -- Try this, it goes up 250 studs and forward 500 studs in 3 seconds end)
Note: This might not fix it, it just makes it cleaner. Edit: You can achieve what you want to do with tween service I believe.
So i got it to work, doesnt look how i want it to so ima mess with it more, but here is the code
local mouse = game.Players.LocalPlayer:GetMouse() local TweenService = game:GetService("TweenService") mouse.Button1Down:Connect(function() local f = game.ReplicatedStorage.Flare:Clone() local humanoidrootpart = script.Parent.Parent:WaitForChild("HumanoidRootPart") f.Parent = workspace local goal = {} f.Orientation = humanoidrootpart.Orientation f.Position = humanoidrootpart.Position goal.Position = f.CFrame.LookVector * 500 + f.CFrame.UpVector * 250 local tweenInfo = TweenInfo.new( 3, -- Time it takes to tween (I think) Enum.EasingStyle.Linear, -- EasingStyle Enum.EasingDirection.Out, -- EasingDirection 0, -- RepeatCount (when less than zero the tween will loop indefinitely) false, -- Reverses (tween will reverse once reaching it's goal) 0 -- DelayTime ) local tween = TweenService:Create(f,tweenInfo,goal) -- Try this, it goes up 250 studs and forward 500 studs in 3 seconds tween:Play() wait(2) f.Anchored = false f.Velocity = f.Velocity * 1 end)